refactor(core): introduce @NgModule.bootstrap
and ngDoBootstrap
method
If a `@NgModule` has a `bootstrap` property, `PlatformRef.bootstrapModule` / `PlatformRef.bootstrapModuleFactory` will automatically bootstrap the components listed in there. If such a property does not exist, `PlatformRef.bootstrapModule` / `PlatformRef.bootstrapModuleFactory` will try to call the method `ngDoBootstrap(appRef: ApplicationRef)` on the module class. Otherwise an error is reported.
This commit is contained in:
@ -81,7 +81,9 @@ export abstract class NgModuleInjector<T> extends CodegenComponentFactoryResolve
|
||||
|
||||
public instance: T;
|
||||
|
||||
constructor(public parent: Injector, factories: ComponentFactory<any>[]) {
|
||||
constructor(
|
||||
public parent: Injector, factories: ComponentFactory<any>[],
|
||||
public bootstrapFactories: ComponentFactory<any>[]) {
|
||||
super(factories, parent.get(ComponentFactoryResolver, ComponentFactoryResolver.NULL));
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user