From 93ade740e2ca19eda84c110b72be2c1b1e214840 Mon Sep 17 00:00:00 2001 From: Tobias Bosch Date: Mon, 1 Aug 2016 02:35:41 -0700 Subject: [PATCH] fix(router): configure DI correctly when using the old `provideRouter` function --- modules/@angular/router/src/common_router_providers.ts | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/@angular/router/src/common_router_providers.ts b/modules/@angular/router/src/common_router_providers.ts index b51f5146c2..cc7322372f 100644 --- a/modules/@angular/router/src/common_router_providers.ts +++ b/modules/@angular/router/src/common_router_providers.ts @@ -54,9 +54,11 @@ export function rootRoute(router: Router): ActivatedRoute { return router.routerState.root; } -export function setupRouterInitializer(injector: Injector, appRef: ApplicationRef) { +export function setupRouterInitializer(injector: Injector) { return () => { - appRef.registerBootstrapListener(() => { injector.get(Router).initialNavigation(); }); + injector.get(ApplicationRef).registerBootstrapListener(() => { + injector.get(Router).initialNavigation(); + }); }; }