How can I use/create dynamic template to compile dynamic Component with Angular 2.0?

In 2021 there still NO WAY in Angular to create component using dynamic HTML (loading html template dynamically), just to save your time.

Even there are a lot of voted up solutions and accepted solution, but all of them will not work for recent versions in production/AOT at least for now.

Basically because Angular does not allow you to define component with :
template: {variable}

As stated by Angular team they are not going to support this approach!!
please find this for reference https://github.com/angular/angular/issues/15275

Leave a Comment