Search code examples
angularionic-frameworkionic4

Ionic / Angular Leave Page Event


I have an Ionic v4 page that configures a number of parameters for my application and I want to stuff all those values into an injected service right before I navigate off of the page so they can be used elsewhere in the application. I am using the Ionic Tabs Control / Page for navigation.

What is the best way to trap an event right before navigating off of the current page?

I have played with @angular/router NavigationStart events but once wired up it fires on all page transitions and I can't tell when I am leaving the desired config page. Or should I be using the old Ionic v3 NavControl?

Or should I just be updating my config service on all changes and not worry about leaving the page?


Solution

  • I would delete my original question if I could but I can't. These issues were all with Beta 16 and now that I have upgraded to RC0, the issue has been resolved. Looks like all I was doing was correct but obviously there were nav related bugs.