Trung BìnhAngular iconAngular

Angular application bootstrap hiện đại hoạt động như thế nào?

Với standalone app, entrypoint thường gọi bootstrapApplication(AppComponent, appConfig).

Ví dụ cấu hình root phổ biến:

typescript
bootstrapApplication(AppComponent, {
  providers: [
    provideRouter(routes),
    provideHttpClient(),
  ],
})

Cách này thay thế pattern cũ platformBrowserDynamic().bootstrapModule(AppModule) trong nhiều project mới, giúp root configuration nằm trong provider functions tree-shakable và dễ tách theo môi trường.

Xem toàn bộ Angular cùng filter theo level & chủ đề con.

Mở danh sách Angular