import { Component , ViewChild } from '@angular/core' ; import { SplashScreen } from '@ionic-native/splash-screen' ; import { StatusBar } from '@ionic-native/status-bar' ; import { Nav , Platform } from 'ionic-angular' ; @ Component ( { templateUrl : 'app.html' } ) export class MyApp { @ ViewChild ( Nav ) nav : Nav ; rootPage : any = 'Page1' ; pages : Array < { title : string ; component : any ; } > ; constructor ( public platform , public statusBar , public splashScreen ) { this . pages = [ { title : 'Page One' , component : 'Page1' } , { title : 'Page Two' , component : 'Page2' } ] ; } ionViewDidLoad ( ) { this . platform . ready ( ) . then ( ( ) => { this . statusBar . styleDefault ( ) ; this . splashScreen . hide ( ) ; } ) ; } openPage ( page ) { this . nav . setRoot ( page . component ) ; } }