How do I create a component from a variable name in Angular similar to what can be achieved in Vue using Dynamic Components:
<component :is="myTemplate.type"></component>
How do I create a component from a variable name in Angular similar to what can be achieved in Vue using Dynamic Components:
<component :is="myTemplate.type"></component>
Before Ivy:
You should use the ComponentFactoryResolver
. You can check out a good example of it here: link
With Angular Ivy
You can use the renderComponent
function. You can check out my blog about Ivy and dynamic component rendering here: link