Reputation: 1401
I have implemented swipeable tabs in Ionic3 which works perfectly. I want to know how to select ContactPage
from ChatsPage
(both are individual tabs in super-tabs
). this.navCtrl.parent.select(0)
is not working with super-tabs
.
<super-tabs tabsHighlight="true" tabsPlacement="top" [selectedTabIndex]="mySelectedIndex" >
<super-tab [root]="contactsRoot" title="My Team" ></super-tab>
<super-tab [root]="chatsRoot" title="Chats" ></super-tab>
<super-tab [root]="callsRoot" title="Call Log" ></super-tab>
</super-tabs>
Any idea on this?
Upvotes: 2
Views: 1219
Reputation: 1401
Finally I got the solution from https://github.com/zyra/ionic2-super-tabs/issues/265#issuecomment-376225616
You need to inject SuperTabsController
in our tab pages and from there call slideTo
,
export class ChatsRootPage {
constructor(private superTabs : SuperTabsController) {}
goToContacts(){
this.superTabs.slideTo(0, 'mainTabs'); // 0 is the index of contactsRoot tab and mainTabs is the id of your super-tabs component.
}
}
Upvotes: 1