Create custom component in angular 4
We can create component using IDE or command line. for using command line, below is the procedure:
Go to angular project and type below command
ng g component <name_of_component>
The folder structure will be as shown in below image:
this component automatically get added in app.module.ts as shown in below image:
Flow of component at backend:
1. We call selector from index.html
2. it is going to main.ts file where it see bootstrapModule configured.
3. then it go to app.module.ts where it looks which bootstrap configured.
and when parent component get called, all child(Custom components) gets loaded.
Flow of component at backend:
1. We call selector from index.html
2. it is going to main.ts file where it see bootstrapModule configured.
3. then it go to app.module.ts where it looks which bootstrap configured.
and when parent component get called, all child(Custom components) gets loaded.