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.
In a standalone app, the entrypoint typically calls bootstrapApplication(AppComponent, appConfig).
Common root configuration:
typescript
bootstrapApplication(AppComponent, {
providers: [
provideRouter(routes),
provideHttpClient(),
],
})This replaces the older platformBrowserDynamic().bootstrapModule(AppModule) pattern in many new projects, keeping root configuration in tree-shakable provider functions that are easier to split by environment.