refactor(core): support non reflective bootstrap.
This changes Angular so that it can be used without reflection (assuming a codegen for injectors).
BREAKIKNG CHANGE:
- Drops `APP_COMPONENT` provider. Instead, inject
`ApplicationRef` and read its `componentTypes` property.
- long form bootstrap has changed into the following:
```
var platform = createPlatform(ReflectiveInjector.resolveAndCreate(BROWSER_PROVIDERS));
var appInjector =
ReflectiveInjector.resolveAndCreate([BROWSER_APP_PROVIDERS, appProviders], platform.injector);
coreLoadAndBootstrap(appInjector, MyApp);
```
This commit is contained in:
@@ -17,6 +17,6 @@ function initRouterListeners(injector: Injector): () => void {
|
||||
return () => {
|
||||
let zone = injector.get(NgZone);
|
||||
|
||||
zone.run(() => injector.get(MessageBasedPlatformLocation).start());
|
||||
zone.runGuarded(() => injector.get(MessageBasedPlatformLocation).start());
|
||||
};
|
||||
}
|
||||
|
||||
@@ -16,5 +16,5 @@ export var WORKER_APP_ROUTER = [
|
||||
];
|
||||
|
||||
function initRouter(platformLocation: WebWorkerPlatformLocation, zone: NgZone): Promise<boolean> {
|
||||
return zone.run(() => { return platformLocation.init(); });
|
||||
return zone.runGuarded(() => { return platformLocation.init(); });
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user