I'm using Ionic 2 and have a set of tabs. Each tab maintains its own navigation stack.
The user is able to go several pages deep into any of the tabs and then switch tab.
The problem is that there are interactions in tab 1 that effect the content of tab 2. What I am finding is that if the user does certain actions in a certain order, then I get an error:
Runtime Error
Uncaught (in promise): removeView was not found
I believe this is because Ionic is attempting to remove a view that no longer exists because the content has changed.
In Tab 1, the user presses a button to load Tab 2. The app saves the selection they made in local storage, which Tab 2 then loads up when on the root page. I select Tab 2 using the following code:
this.navCtrl.parent.select(1);
I believe I can prevent this problem by going to the root of the nav stack when the tab is selected, but how can I do that?
I tried:
this.navCtrl.parent.select(1);
this.navCtrl.parent.goToRoot();
But with this, nothing happens. The tab doesn't change and there are no errors.
So, my question: How can I change a tab and navigate to the root of the navigation stack from another tab?