ionic 4 lifecycle code example
Example 1: ionic lifecycle
ionViewWillEnter() // Fired when the component routing to is about to animate into view.
ionViewDidEnter() // Fired when the component routing to has finished animating.
ionViewWillLeave() // Fired when the component routing from is about to animate.
ionViewDidLeave() // Fired when the component routing to has finished animating.
Example 2: ionviewwillenter in ionic 5
ngAfterViewInit()