bootstrapApplication()

Bootstraps a standalone root component without an NgModule.

Since Angular 14+ Spec ↗

Syntax

bootstrapApplication(rootComponent, options?): Promise<ApplicationRef>

Parameters

NameTypeRequiredDescription
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.