-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecross-cutting: standaloneIssues related to the NgModule-less worldIssues related to the NgModule-less world
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
bootstrap multiple standalone components is now not supported whille it can be done with NgModule
there is index.html
like below
<html>
<body>
<some-ng-component></some-ng-component>
<app-root></app-root>
</body>
</html>
both the app-root
and some-ng-component
are components declared by @Component
with NgModule
both the components can be bootstrap at the same time by app.module.ts
and main.ts
// app.module.ts
@NgModule({
bootstrap: [
AppComponent,
SomeNgComponent,
],
})
export class AppModule { }
// main.ts
platformBrowserDynamic().bootstrapModule(AppModule)
.catch(err => console.error(err));
but with standalone components it can only bootstrap one componet at a time
// main.ts
bootstrapApplication(AppComponent, appConfig)
.catch(err => console.error(err));
Proposed solution
multiple standalone components can be bootstrapped in main.ts
may be a component array will be accepted in the bootstrapApplication
function like
// main.ts proposed
bootstrapApplication([AppComponent, SomeNgComponent], appConfig)
.catch(err => console.error(err));
Alternatives considered
the other component I want to bootstrap with AppComponent may often has some non-biz logic like titlebar
or action bar
or a welcome screen that should be initialized at the earliest time
Sorry for my poor English 😅
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecross-cutting: standaloneIssues related to the NgModule-less worldIssues related to the NgModule-less world