Angular is a JavaScript framework that is very usefull in creation of single page web applications.
In this article we will discuss on how the angular application is loaded. The angular app has the following main files that are responsible for loading the angular application
1. index.html
2. main.ts
The angular application needs the root component that must be loaded to load the entire application.
When we observe index.html we can see that angular CLI by default creates app.component.ts which has an attribute selector 'app-root'. which is used in index.html as shown bellow
The main.ts is the file that is responsible to actually load the initial module , by default iangular CLI creates app.module.ts and injects it into the PlatformBrowserDynamic to load that module.
Inside the app.module.ts we have all the functionalities of an angular module. This module has an bootstrap array which decides all the components that are required to sart the application in our case app.component.ts is required which serves as the entrypoint to our application.
The loading process is as follows
1. Angular Application loads main.ts
2. main.ts loads the root module
3. Root module loads dependent components.
4. index.html has the root component in it.
5. All the other components are loaded inside the root components.
In this article we will discuss on how the angular application is loaded. The angular app has the following main files that are responsible for loading the angular application
1. index.html
2. main.ts
The angular application needs the root component that must be loaded to load the entire application.
When we observe index.html we can see that angular CLI by default creates app.component.ts which has an attribute selector 'app-root'. which is used in index.html as shown bellow
The main.ts is the file that is responsible to actually load the initial module , by default iangular CLI creates app.module.ts and injects it into the PlatformBrowserDynamic to load that module.
Inside the app.module.ts we have all the functionalities of an angular module. This module has an bootstrap array which decides all the components that are required to sart the application in our case app.component.ts is required which serves as the entrypoint to our application.
The loading process is as follows
1. Angular Application loads main.ts
2. main.ts loads the root module
3. Root module loads dependent components.
4. index.html has the root component in it.
5. All the other components are loaded inside the root components.





0 Comments