On tab change clear previous tab nav history



I’m building my first Ionic2 app and need some advice on how to clear a nav history when a user changes tabs. So whenever a user changes tabs, they will always be presented with that tab’s root page.

I’ve tried various things like on onPageWillEnter() and onPageWillLeave() but I haven’t found out how to access the previous/next nav object so as to clear the nav stack.

I’m probably attacking this from the wrong angle, so if someone can point me in the right direction that would be great.



Perhaps a better way is using Tabs change(). However it would be useful to know the “fromTab” and “toTab”. Is it possible to get these?



Hi @crabbey - did you ever find a solution to this one?


See this link for an option that worked well for me.