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:
@ -269,6 +269,7 @@ export function main() {
|
||||
]
|
||||
})
|
||||
class SomeModule {
|
||||
ngDoBootstrap() {}
|
||||
}
|
||||
|
||||
expect(log.result()).toEqual('platform_init1; platform_init2');
|
||||
|
Reference in New Issue
Block a user