import { Component , ViewChild } from '@angular/core' ; import { Nav , Platform } from 'ionic-angular' ; import { StatusBar , Splashscreen } from 'ionic-native' ; import { TabsPage } from '../pages/tabs/tabs' ; import { SettingsPage } from '../pages/settings/settings' ; import { AccountPage } from '../pages/account/account' ; @ Component ( { templateUrl : 'app.html' } ) export class MyApp { @ ViewChild ( Nav ) nav : Nav ; rootPage = TabsPage ; pages : Array < { title : string ; component : any ; } > ; constructor ( public platform ) { this . initializeApp ( ) ; this . pages = [ { title : 'Homepage' , component : TabsPage } , { title : 'Settings' , component : SettingsPage } , { title : 'Account' , component : AccountPage } ] ; } openPage ( page ) { this . nav . setRoot ( page . component ) ; } initializeApp ( ) { this . platform . ready ( ) . then ( ( ) => { StatusBar . styleDefault ( ) ; Splashscreen . hide ( ) ; } ) ; } }