Ng7 Booting Process - rishi0624/ng7-notes GitHub Wiki
Booting Process
Step 1.
main.ts: The step entry point of every angular application is main.ts file. which perform the following task:
- import enableProdMode module.
- import plateformBrowserDynamic module.
- import AppModule module .
- import environment module.
- check application is working on production mode or development mode.
- kickstart the platformBrowserDynamic() method and .bootstrapModule(AppModule) with passing the AppModule as a parameter.
like as : platformBrowserDynamic().bootstrapModule(AppModule) :
* platformBrowserDynamic(): This method strat compiler and run the application on the client using the compiler.
* bootstrapModule(AppModule): This method kickstart the app module.
Step 2. :
App Module : AppModule is the first entry module of our application
- import BrowserModule module.
- import NgModule module.
- import App Component .
- include @NgModule decorator.
- export class AppModule {} : This line export the app module so other component and module can access this AppModule.
@NgModule({
declarations: [AppComponent] , // This array used to register particular component with this module
imports: [BrowserModule] , // This array used to register other module to achieve the functionally.
providers: [ ], // this array is used to register the service, directives and pipes which is available application wide.
bootstrap: [AppComponent] // this array Kickstart the App Component. and tell the module which component is called now.
})