In Ionic 3 we used the ionViewWillEnter lifecycle event to reload data when navigating back to a page.
ionViewDidLoad gets called only when the page component is loaded, but ionViewWillEnter is called whenever the page is navigated to; regardless of whether it’s a navPop or nav.push.
However, Ionic 4 uses Angular routing, which doesn’t seem to have a lifecycle hook for when a component is navigated back to. How can we detect when a page component is navigated back to?
We added a willEnter() function to our <appName>Page interface. Each page in the app implements the <appName>Page interface. In the app.component.ts we listen for activate events and call the activatedPage.willEnter() function.