I have created an Angular app using Angular CLI and created one component:
ng g c parent.
How do I create child components (e.g. child1 and child2) and integrate them with a parent using angular CLI?
I am trying to create a simple example and understand in some example parent-child component relationship.
If you mean to nest the components into the parent you can do it like this
ng generate component parent/child1
ng generate component parent/child2
This generates the child components inside the parent folder. I do this in my apps to keep together what belongs together! Hope it helped
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With