DoBootstrap

Hook for manual bootstrapping of the application instead of using bootstrap array in @NgModule annotation.

查看"说明"...

      
      interface DoBootstrap {
  ngDoBootstrap(appRef: ApplicationRef): void
}
    

说明

Reference to the current application is provided as a parameter.

See "Bootstrapping" and "Entry components".

方法

ngDoBootstrap(appRef: ApplicationRef): void
      
      ngDoBootstrap(appRef: ApplicationRef): void
    
参数
appRef ApplicationRef
返回值

void

使用说明

class AppModule implements DoBootstrap { ngDoBootstrap(appRef: ApplicationRef) { appRef.bootstrap(AppComponent); // Or some other component } }
      
      class AppModule implements DoBootstrap {
  ngDoBootstrap(appRef: ApplicationRef) {
    appRef.bootstrap(AppComponent); // Or some other component
  }
}