Angular Component Constructor Called Twice Angular Component Constructor Called Twice typescript typescript

Angular Component Constructor Called Twice


Your problem is that in the app.module you bootstrap both parent and child component:

bootstrap:    [ ParentItemComponent, ChildItemsComponent ]

It has to be

  bootstrap:    [ ParentItemComponent]


child-items is not closed properly. Probably because of this error

This

<child-items [parentItemId]="parentItemId">Loading...</<child-items>

should be:

<child-items [parentItemId]="parentItemId">Loading...</child-items>