bootstrapApplication()
Bootstraps a standalone root component without an NgModule.
Syntax
bootstrapApplication(rootComponent, options?): Promise<ApplicationRef> Parameters
| Name | Type | Required | Description |
|---|---|---|---|
rootComponent | Type | No | The standalone root component to mount. |
options | object | No | ApplicationConfig with a providers array. |
Returns
Promise<ApplicationRef> — Resolves once the app is bootstrapped.
Examples
import { bootstrapApplication } from '@angular/platform-browser';
import { provideRouter } from '@angular/router';
import { provideHttpClient } from '@angular/common/http';
import { AppComponent } from './app/app.component';
import { routes } from './app/app.routes';
bootstrapApplication(AppComponent, {
providers: [provideRouter(routes), provideHttpClient()],
});
Notes
This is the modern entry point that replaces platformBrowserDynamic with an
AppModule. Register application-wide providers via the providers array using
functional providers like provideRouter and provideHttpClient.