import { Component , ViewChild } from '@angular/core' ; import { Nav , Platform , LoadingController } from 'ionic-angular' ; import { StatusBar } from '@ionic-native/status-bar' ; import { LandingPage } from '../pages/landing-page/landing-page' ; import { TabsBottom } from '../pages/tabs-bottom/tabs-bottom' ; import { TabsBottom2 } from '../pages/tabs-bottom2/tabs-bottom2' ; @ Component ( { templateUrl : 'app.html' } ) export class MyApp { @ ViewChild ( Nav ) nav : Nav ; rootPage : any = LandingPage ; pages : Array < { title : string ; component : any ; } > ; constructor ( public platform , public loadingCtrl , private statusBar ) { this . initializeApp ( ) ; this . pages = [ { title : 'Tabs Bottom' , component : TabsBottom } , { title : 'Tabs Bottom Type 2' , component : TabsBottom2 } ] ; } initializeApp ( ) { this . platform . ready ( ) . then ( ( ) => { this . statusBar . styleDefault ( ) ; } ) ; } openPage ( page ) { let loading = this . loadingCtrl . create ( { content : 'Loading ...' } ) ; loading . present ( ) ; this . nav . setRoot ( page . component ) . then ( ( ) => { loading . dismiss ( ) ; } ) ; } openRootPage ( ) { this . nav . goToRoot ( { } ) ; } }