Use an ngOnInit in this way to call a parent's ngOnInit from a child component which will otherwise not go off if the child component has an ngOnInit.
ngOnInit():void {
super.ngOnInit();
childishStuff();
}
Removing the child's ngOnInit would also be another way to get the parent's ngOnInit to fire off, but then you couldn't do childishStuff();
No comments:
Post a Comment