[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/core/DoBootstrap [Back]  [Original]

DoBootstrap Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/core

DoBootstrap

interface
stable

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.

On this page

    arrow_upward_alt Back to the top

    API

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

    ngDoBootstrap

    void
    @paramappRefApplicationRef
    @returnsvoid

    Description

    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.

    Reference to the current application is provided as a parameter.

    See "Bootstrapping".

    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
      }
    }
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page