How to navigate the ionic tabs

0

Hello! I created the tabs in my ionic html and I want when I click open the target page, the right tabs appear but when clicking only changes the icons to active and not the page, my code is like this no home.html

<ion-footer>
 <ion-toolbar>
   <ion-tabs>
      <ion-tab [root]="homeRoot" tabTitle="Chat" tabIcon="information-
        circle"></ion-tab>      
      <ion-tab [root]="listroot" tabTitle="Chat" tabIcon="information-
        circle"></ion-tab>  
   </ion-tabs> 
 </ion-toolbar>
</ion-footer>

code in home.ts

 export class HomePage {

 homeRoot = ChatPage
 listroot = ListPage

 constructor(public navCtrl: NavController) {} }
    
asked by anonymous 10.01.2018 / 14:11

1 answer

1

Name the tab

<ion-tabs #myTabs>

@ViewChild('myTabs') tabRef: Tabs;

this.tabRef.select(1); //1 é o índice da tab
    
18.07.2018 / 19:43