I want to dynamically load the child components in angular. Parent component will load the child components based on some conditions.
Is it possible that we define the child component names in parent component typescript file and in HTML we use string interpolation to load the component?
For example in parent component typescript:
componentName = someCondition ? 'component1' : 'component2';
And in HTML
<app-{{componentName}}></app-{{componentName}}
I tried this but it's not working. Would appreciate any help on this!