fix(router): configure DI correctly when using the old `provideRouter` function

This commit is contained in:
Tobias Bosch 2016-08-01 02:35:41 -07:00
parent a46437c57d
commit 93ade740e2
1 changed files with 4 additions and 2 deletions

View File

@ -54,9 +54,11 @@ export function rootRoute(router: Router): ActivatedRoute {
return router.routerState.root; return router.routerState.root;
} }
export function setupRouterInitializer(injector: Injector, appRef: ApplicationRef) { export function setupRouterInitializer(injector: Injector) {
return () => { return () => {
appRef.registerBootstrapListener(() => { injector.get(Router).initialNavigation(); }); injector.get(ApplicationRef).registerBootstrapListener(() => {
injector.get(Router).initialNavigation();
});
}; };
} }