Wondering how I can do this. When using ionic tabs, lets say I have a simple structure like
Home
About
Product -> Product Info
In my Products page (product.ts) I have something like
viewItem(payload) {
this.navCtrl.push(ResultPage, {
data: payload
});
}
// ^ Pass data to new Product info page.
The product info page loads fine all data passes in and I get a back arrow in the nav bar.
Now if I click another tab like About and go back to Product it still shows the pushed Product Info page.
How can I get it to reset back to the Product page when I leave the view and navigate back?
Update:
If I do this
ionViewDidLeave() {
this.viewCtrl.dismiss().catch(() => console.log('Some bug going on..'));
}
Works, but have to catch the error otherwise returns
Runtime Error Uncaught (in promise): false
Looks like its a bug - https://github.com/driftyco/ionic/issues/10046
If anyone has any other suggestion its much appreciated.