Ionic Tab Index Not Update

Hi,
I’m trying to change an ionic tab from the TS code using something like:

var t: Tabs = this.navCtrl.parent;
t.select(1);

On my html I have:
<ion-tabs [selectedIndex]=“tabIndex” (ionChange)=“tabChange($event)”>

The problem is on tabChange function, the Tab object received has an index different of tabIndex variable. Why this is happening?

Thank you

Try this:
t.select(0);

the index start in 0

Hi, @rodrigosoaresc

For, getting current tab index in tab ts file use ionic Tab like this,

import { Tab } from 'ionic-angular';

constructor(public tab: Tab){
     console.log(this.tab.index);
}

Thanks.

Thank you, I’m already doing this