I have an Ionic 3 app with 4 tabs. The first tab is the home screen, the other tabs have lists, and tapping any list item goes to a details page (still on the same tab).
How do I redirect to a particular details page in the tab? I know about navCtrl.parent.select(number)
which selects a different tab, but is there a way to pass a parameter, so that when the tab opens, it checks to see if a parameter was passed, and if so, show its details page?
Here’s what I tried
this.navCtrl.parent.select(3,{itemId:'12345'});
On the page in the 4th tab, I have the following…
if (this.params.get('itemId'))
this.navCtrl.push('ItemDetails', {'itemId':this.params.get('itemId')});
else
console.log("What the heck? ", this.params.get('itemId')); // undefined
It correctly goes to the 4th tab showing the list, but didn’t open the ItemDetails page.
Any ideas?
Thanks.