Application Loading Sequence with Angular CLI

When we create an angular application with Angular-CLI, it creates a skeleton project with many folders and files. In this blog,  we will be only focusing on the application loading sequence i.e. which files get loaded first and which follows it and so on.

When we run ng serve command, files are loaded in following sequence:





index.html

It is the main HTML page.

Angular CLI automatically adds all JavaScript and CSS files when building your app





main.ts

The main entry point for your application.

Compiles the application with the JIT compiler and

Bootstraps the application's root module (AppModule) to run in the browser.




app/app.module.ts

Defines the root module, named AppModule, that tells Angular how to assemble the application.

Initially declares only the AppComponent. As you add more components to the app, they must be declared here.




app/app.component.ts

Defines the logic for the app's root component, named AppComponent.

The view associated with this root component becomes the root of the view hierarchy as you add components and services



Comments

Popular posts from this blog

Cheat Sheet - Git

Stack implementation using VanillaJS

JavaScript Best Practices