I have a simple @NgModule
the boostrap 2 components :
// Global module for all Angular Component
@NgModule({
declarations: Components, // directives, components, and pipes owned by this NgModule
imports: [BrowserModule, HttpModule, FormsModule],
providers: Providers,
bootstrap: [Menu, Main]
})
export class MenuModule { }
I want to store a reference of my Main
component bootstraped by my MenuModule
. I tried to implement the .then
method of bootstrapModuleDynamic()
, but I only get the factory of the component.
// Bootstrap of module
platformBrowserDynamic()
.bootstrapModule(MenuModule)
.then((menuModule: NgModuleRef<MenuModule>) => {
var test: ComponentFactory<Main> = (<any>menuModule).bootstrapFactories[0];
});
Any ideas ?