ionic component life cycle hook code example
Example: 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.