Capturing ion-tab click on active tab event

[DEPRECATED (with new solution) ]

If you close and reopen the Tabs page, a new ID will be generated for the new Tabs page if not destroyed properly.

The name will go from “tab-t0-1” to “tab-t1-1”. So you need to ensure that you generate the subscription for several different IDs every time you trigger the ngAfterViewInit().

I iterated through the different IDs until an ID was not undefined and then I triggered the subscription with the existing IDs.

Hope it helps (again)! :slight_smile:

Thank you sooo much! It works for me!

the OP asks about Ionic2, in Ionic3
IonSelect() only fires the first time, but not when the tab is already active.
I needed something to set focus to the child components of the pages associated with each tab. I am using the following

Either (click) or (tap) works but set it at the <ion-tabs level not <ion-tab
You will need to save/cache your Tab.index as shown above, with (ionChange)=“TabChanged($event)”