What are the implications of bootstrapping multiple components

前端 未结 1 958
谎友^
谎友^ 2021-01-13 20:57

I can do the following:

@NgModule({
    imports: [BrowserModule],
    declarations: [AppComponent, BComponent],
    bootstrap: [AppComponent, BComponent] <         


        
相关标签:
1条回答
  • 2021-01-13 21:53

    Am I just going to have two trees of components with a single injector

    Yes, you will have two independent root trees. They will be registered under ApplicationRef.views and when ApplicationRef.tick() function will be called Angular will run change detection for both trees. It will be single application and they will share the injector defined for the AppModule.

    0 讨论(0)
提交回复
热议问题