I\'ve tried many stackoverflow options like Load existing components dynamically Angular 2 Final Release.
What i want to do is get a html page with a ajax request an
I made tiny changes for using my own components (such as HomeComponent) at @Yurzui and @Linksonder 's solutions. https://plnkr.co/edit/27x0eg?p=preview
It's basically adding AppModule to DynamicHtmlModule as additional import inside of createComponentFactory().
@NgModule({ imports: [AppModule, CommonModule, RouterModule, SharedModule], declarations: [decoratedCmp] })
class DynamicHtmlModule { }
And exports our own components at AppModule
@NgModule({
...
exports: [HomeComponent, AboutComponent],
...
})
export class AppModule { }