fix(router): configure DI correctly when using the old `provideRouter` function
This commit is contained in:
parent
a46437c57d
commit
93ade740e2
|
@ -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();
|
||||||
|
});
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue