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