Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

DoBootstrap

Hook for manual bootstrapping of the application instead of using bootstrap array in @NgModule annotation. This hook is invoked only when the bootstrap array is empty or not provided.

See more...

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

Description

Reference to the current application is provided as a parameter.

See "Bootstrapping".

Further information is available in the Usage Notes...

Methods

      
      ngDoBootstrap(appRef: ApplicationRef): void
    
Parameters
appRef ApplicationRef
Returns

void

Usage notes

The example below uses ApplicationRef.bootstrap() to render the AppComponent on the page.

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