Answer the question
In order to leave comments, you need to log in
How to dynamically set a component in Angular?
Vue.js has the ability to specify the is attribute , which allows you to dynamically set the component in the template, i.e. , it will render the component whose tag name is in comp.
Is it possible to do the same (or somehow differently) in Angular? <my-comp :is="comp"> ... </my-comp>
Answer the question
In order to leave comments, you need to log in
For dynamic rendering of a component, there is a structural directive *ngTemplateOutlet:
https://angular.io/api/common/NgTemplateOutlet
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question