I'm looking for a way to load dynamically angular component. The component name should be stored in a json file, and the service should load the component according to its name in the json file. The second step should be storing the html of the rendered component into a div innerHTML. I'm already doing it using a regular HTML page.
Asked
Active
Viewed 402 times
1
-
Seems like [ngTemplateOutlet](https://angular.io/api/common/NgTemplateOutlet) might be what you're looking for. https://stackblitz.com/edit/angular-ng-container-conditional?file=app%2Fapp.component.html – nll_ptr Nov 23 '19 at 21:03
-
May be you can save selector of component and you can render it like the following https://stackoverflow.com/a/44082399/10377603 – nevzatopcu Nov 23 '19 at 23:16