Reputation: 21
I am going to add a dynamic component to the Angular template. Usually, it is done by creating a dynamic component via the existing ViewContainerRef in the template. But what about the situation where there is no ability to define manually? Is there some ability to put the view container to DOM programmatically? Like it can be done for other types of DOM Nodes via Renderer2's createElement method.
I tried to add ng-container via Renderer2, but it behaves as DOM element, not as view container ref.
Upvotes: 2
Views: 382