Friday 21 July 2017

Create custom component in angular 4

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.

No comments:

Post a Comment

Extract error records while inserting into db table using JDBCIO apache beam in java

 I was inserting data into postgres db using apache beam pipeline. it works perfectly with JdbcIO write of apache beam library. But, now, i ...