1

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.

Guy E
  • 1,775
  • 2
  • 27
  • 55
  • 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

0 Answers0