Angular Application WorkFlow
Angular Application WorkFlow
This workflow shows how angular applications work with their components and
modules. The following diagram shows the process of an Angular application.
There are a few basic steps that tell us how Angular applications perform their
work. In a normal Angular application, we have 1 Index.html, Module, Component,
Main. These are the most important parts of Angular application.
Example
<body>
<app-root></app-root>
</body>
Declarations:[]
Example:
Declarations: [AppComponent
],
Imports:[]
Imports are used to import all Modules that the user wants to add in the Angular
Application.
Example
Providers:[]
Example
Bootstrap:[]
Bootstrap is used to register the component that the User wants to display first on
the Browser.
Example
Bootstrap:[ AppComponent]
Template:” ”
Example
Template: ‘ <html>
Hello world
</html>’
TemplateUrls:” ”
Example
TemplateUrls: ’ ./app/AppComponent’
Class
Class contains Property and methods. Class is defined in Typescript. The class has the
following syntax:
Metadata
Example
1. @Component({
2. Selector: ”App - Root”,
3. TemplateUrls: ”. / app / Appcomponent.html”
4. });
5. Export class AppComponent {
6. Title: String = ”Chaman Gautam”
7. }
Step 1
When the user hits “Localhost:4200” on browser then browser run index.html file.
Then in Index.html file, check the selector name to see which is presented in the
Index.html file
Step 2
After checking the Selector name, it will be called/executed in the Main.ts file. It then
checks which Module is registered in Main.ts. Then it calls to the Registered Module.
Step 3
After calling the Module, it will check how many components are registered in this
module. Then it checks which component is registered in the Bootstrap.
Step 4
Then it will check the registered component. Then it will check the Selector name
because each component has an associated Selector name.
Step 5
Then it will find the Selector name. It will display which component selector is
registered in the index.html file. The component is run on the Index.html
Example
index.html
1. <!doctype html>
2. <html lang="en">
3. <head>
4. <meta charset="utf-8">
5. <title>Creativity</title>
6. <base href="/">
7. <meta name="viewport" content="width=device-width, initial-scale=1">
8. <link rel="icon" type="image/x-icon" href="favicon.ico">
9. </head>
10. <body>
11. <app-root></app-root>
12. </body>
13. </html>
Main.ts
Module.ts
Appcomponent.ts
Appcomponent.html
1. <br>
2. <br>
3. <fieldset>
4. <h2>WorkFlow of angular</h2>
5. </fieldset>
Now compile this example by "ng serve". And after Compilation, run the project on
the browser to hits " localhost:4200". After run this project output will display like,