Navigate to details page in another tab with a list


#1

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.


#2

As a workaround, what I’m doing is to save the variable to native storage on the calling page, then navCtrl.push() to the tab with lists. If that list page detects the variable in native storage, it then forwards to its details page (then deletes it from native storage).
I don’t really like this solution, but it works for now. If anyone can come up with a better way, I’d appreciate it.