import { Component } from '@angular/core' ; import { NavParams , Tab , Tabs } from 'ionic-angular' ; import { BookingsPage } from '../bookings/bookings' ; import { WelcomePage } from '../welcome/welcome' ; import { LocationListPage } from '../location-list/location-list' ; import { AccountPage } from '../account/account' ; @ Component ( { templateUrl : 'tabs.html' } ) export class TabsPage { tab1Root : any = WelcomePage ; tab2Root : any = LocationListPage ; tab3Root : any = BookingsPage ; tab4Root : any = AccountPage ; mySelectedIndex : number ; constructor ( navParams ) { this . mySelectedIndex = navParams . data . tabIndex || 0 ; } showRoot ( tabs , index ) { let tab = tabs . getByIndex ( index ) ; let views = tab [ '_views' ] ; if ( views . length > 1 ) { let navController = views [ views . length - 1 ] . instance . navCtrl ; if ( navController ) { navController . popToRoot ( { animate : false } ) ; } } } }