RouterUpgradeInitializer

Creates an initializer that in addition to setting up the Angular router sets up the ngRoute integration.

查看"说明"...

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

说明

@NgModule({ imports: [ RouterModule.forRoot(SOME_ROUTES), UpgradeModule ], providers: [ RouterUpgradeInitializer ] }) export class AppModule { ngDoBootstrap() {} }
      
      
  1. @NgModule({
  2. imports: [
  3. RouterModule.forRoot(SOME_ROUTES),
  4. UpgradeModule
  5. ],
  6. providers: [
  7. RouterUpgradeInitializer
  8. ]
  9. })
  10. export class AppModule {
  11. ngDoBootstrap() {}
  12. }