I am working on an Angular Project, with Ionic 4.
When Child Page is called from Parent Page's HTML using HTML Selector, child page's Ionic Lifecycle Hooks do not fire. Why is it so? How do I use these hooks?
Child Page:
@Component({
selector: 'app-child',
templateUrl: './child.page.html',
styleUrls: ['./child.page.scss']
})
export class ChildPage {
ionViewWillEnter() {
console.log(`ionView-Will-Enter`);
// Code goes here...
}
ionViewWillLeave() {
console.log(`ionView-Will-Leave`);
// Code goes here...
}
}
Parent HTML:
<ng-container>
<app-child></app-child>
</ng-container>