How to get the tab index from a root page?


A code snippet:

  <ion-tab [root]="tab1Root"></ion-tab>
  <ion-tab [root]="tab2Root"></ion-tab>

I would like to get the tab index from the classes of the pages linked to tab1Root and tab2Root.


I think this is a mistake. Each of those pages should be completely self-contained and independent agents. They should neither know nor care how they are hosted. To do otherwise makes your app spaghetti.

I have a step-by-step form. The start button is in the tab pages. Inside this form there is another button to redirect the user to the origin tab page if he wants to cancel the form fullfillment.

How would you do?

Using modals. Tabs need to be stable and always interchangeable, which is incompatible with the sort of wizard you describe.