import { Component , ViewChild } from '@angular/core' ; import { Nav , Platform } from 'ionic-angular' ; import { StatusBar } from '@ionic-native/status-bar' ; import { SplashScreen } from '@ionic-native/splash-screen' ; @ Component ( { templateUrl : 'app.html' } ) export class MyApp { @ ViewChild ( Nav ) nav : Nav ; rootPage : any = 'Example_1Page' ; pages : Array < { title : string ; component : any ; } > ; constructor ( public platform , public statusBar , public splashScreen ) { this . initializeApp ( ) ; this . pages = [ { title : 'First example' , component : 'Example_1Page' } , { title : 'Second example' , component : 'Example_2Page' } , { title : 'Third example' , component : 'Example_3Page' } , { title : 'Fourth example' , component : 'Example_4Page' } , { title : 'Fifth example' , component : 'Example_5Page' } , ] ; } initializeApp ( ) { this . platform . ready ( ) . then ( ( ) => { this . statusBar . styleDefault ( ) ; this . splashScreen . hide ( ) ; } ) ; } openPage ( page ) { this . nav . setRoot ( page . component ) ; } }