Get Even More Visitors To Your Blog, Upgrade To A Business Listing >>

What’s the difference between a bootstrap component and an entry component?

A bootstrapped Component is an Entry Component that Angular loads into DOM at the application launch and the other root components loaded dynamically into entry components.

The following is an example of specifying a bootstrapped component -
@NgModule({
  declarations: [
    AppComponent,
    LoginComponent
  ],
  imports: [
    BrowserModule,
    FormsModule,
    HttpModule,
    AppRoutingModule
  ],
  providers: [],
  bootstrap: [AppComponent]  // bootstrapped entry component
})
exportclass AppModule{ }


The entry component is used to define components and created dynamically using the ComponentFactoryResolver.

The @NgModule.bootstrap property report the compiler that this is an entry component and it should generate code to bootstrap the application with this component.

For more information, see the above question - What Is an Entry Component?

I hope you enjoyed this post. So please write your thoughts in the below comment box. Thank you so much for reading this post.

Share the post

What’s the difference between a bootstrap component and an entry component?

×

Subscribe to Angular 2 Javascript Asp.net C# Sql Server Knockoutjs Angularjs Kendo Ui Html 5 Web Api Wpf Wcf Etc.

Get updates delivered right to your inbox!

Thank you for your subscription

×