Render ngTemplates dynamically using ViewContainerRef in Angular

Loading

Reading Time: 5 minutes Introduction In Angular, we use ngTemplateOutlet to display ngTemplate when we know which ones and the exact number of them during development time. The other option is to render ngTemplates using ViewContainerRef class. ViewContainerRef class has createEmbeddedView method that instantiates embedded view and inserts it to a container. When there are many templates that render … Read more