diff --git a/modules/@angular/router/src/common_router_providers.ts b/modules/@angular/router/src/common_router_providers.ts index 01f8df5070..b59a27ceca 100644 --- a/modules/@angular/router/src/common_router_providers.ts +++ b/modules/@angular/router/src/common_router_providers.ts @@ -61,9 +61,13 @@ export function provideRouter(config: RouterConfig): any[] { // APP_INITIALIZER -> Router) setTimeout(_ => { const appRef = injector.get(ApplicationRef); - appRef.registerBootstrapListener((_) => { + if (appRef.componentTypes.length == 0) { + appRef.registerBootstrapListener((_) => { + injector.get(Router).initialNavigation() + }); + } else { injector.get(Router).initialNavigation() - }); + } }, 0); return _ => null; },