W3cubDocs

/Angular 12

RouterUpgradeInitializer

const

Creates an initializer that sets up ngRoute integration along with setting up the Angular router.

const RouterUpgradeInitializer: { provide: InjectionToken<((compRef: ComponentRef<any>) => void)[]>; multi: boolean; useFactory: (ngUpgrade: UpgradeModule) => () => void; deps: (typeof UpgradeModule)[]; };

Usage notes

@NgModule({
 imports: [
  RouterModule.forRoot(SOME_ROUTES),
  UpgradeModule
],
providers: [
  RouterUpgradeInitializer
]
})
export class AppModule {
  ngDoBootstrap() {}
}

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/router/upgrade/RouterUpgradeInitializer