Reputation: 211
I have 2 components Parent and Child component
inside parent component template I am using the selector of the Child component.
which component template is loaded first after running the application on a local server
and which component constructor() and ngOnInit() will get executed first ?
when i debug it in my case it executing in the following way
1) constructor() of parent
2)constructor() of child
3)ngOnInit() of parent
4) ngOnInit() of child
Upvotes: 0
Views: 1165
Reputation: 1
Yes, Always the parent component is loaded first as child component is a part of parent component it cannot be loaded before parent component
Upvotes: 0