Imagine you have a modal component, and you want users to define custom header, body, and footer for each modal instance. How would you set up the modal component to achieve this?

  • Use Angular Templates for Header, Body, and Footer
  • Use ng-container for Header, Body, and Footer
  • Use Angular Dynamic Components for Header, Body, and Footer
  • Use ng-template for Header, Body, and Footer
To allow users to define custom header, body, and footer for each modal instance in Angular, you should use Angular Dynamic Components. This approach allows users to create and insert components dynamically at runtime, making it suitable for the scenario where custom content needs to be defined for each modal instance. While other options like templates, ng-container, and ng-template can be used for various purposes, they don't provide the same level of flexibility as dynamic components in this context.
Add your answer
Loading...

Leave a comment

Your email address will not be published. Required fields are marked *