An Angular application gets loaded or started by the following way:
1ïļâĢ ððĻðð ðĒð§ðððą.ðĄððĶðĨ ð
The starting point of any Angular web application is the index.html page.
Code ðĻâðŧððð
<âðĄðð ðððð="ðð">
<âððð>
...
<ðĄððĄðð>ðšððĄðĄðððððĄðððĄðð
...
<ððððĶ>
<ððð-ððððĄ>
...
<ðððððð ððð="ðððð-ðð2015.ðð" ðððð="ððð ððð">
<ðððððð ððð="ðððð-ðð5.ðð" ððððð ððð ð ðððð>
ðĄ Notice the main.js which has the application code in it.
2ïļâĢ ððąðððŪðð ðĶððĒð§.ððŽ ð ðĒðĨð âĄ
The code inside the main.js file is the entry point for the application.
It does this thanks to the module platformBrowserDynamic.
Code ðĻâðŧððð
ððððĄðððððĩðððĪð ððð·ðĶððððð().ððððĄð ðĄðððððððĒðð(ðīððððððĒðð);
ðĄ This loads the AppModule.
3ïļâĢ ððĻðð ððĐðĐ-ðððŊððĨ ððĻððŪðĨð ðĶ
The app-level module or root module has one app-level component or root component.
The bootstrap property or key of the NgModule decorator specifies which component should be loaded by Angular when the app-level module loads.
Code ðĻâðŧððð
ððððĄð ðĄððð: [ðīðððķððððððððĄ]
ðĄ Thus the AppComponent is loaded.
4ïļâĢ ððĻðð ððĐðĐ-ðððŊððĨ ððĻðĶðĐðĻð§ðð§ð âïļ
The App component controller contains:
Code ðĻâðŧððð
@ðķððððððððĄ({
ð ðððððĄðð: 'ððð-ððððĄ',
ðĄððððððĄðððð: './ððð.ðððððððððĄ.âðĄðð',
ð ðĄðĶðððððð : ['./ððð.ðððððððððĄ.ð ðð ð ']
})
ððĨððððĄ ðððð ð ðīðððķððððððððĄ {...
ðĄ Thus, the next step is the proceeding of the template app.component.html.
5ïļâĢ ððŦðĻðððŽðŽ ðððĶðĐðĨððð ðžïļ
The templateURL property points to the HTML template file, which will be rendered to the browser when this component is processed.
And this template in html will call the components whcih will call other components till you get all you require according to your app design.
Code ðĻâðŧððð
<âððððð>
<ðððĢ ðððð ð ="ðððĶððĒðĄ-ððððĒðð ððĄðð-ððð ðĄ ððĒð ðĄðððĶ-ððððĄðððĄ-ððððĄðð">
<â3>ðĩððð ðŋðð ðĄ
<ðððĄð-ððð ðĄ [ðððĄððŋðð ðĄ]="" [ðððĄðððĶðð]="ðĩððð" (ðððžðĄððð·ððððĄð)="ðððžðĄððð·ððððĄð($ððĢðððĄ)">
<ððððĄðð>
#angular #boostrapping #til