import { Component , ViewChild } from '@angular/core' ; import { Nav , Platform } from 'ionic-angular' ; import { StatusBar , Splashscreen } from 'ionic-native' ; import { Page1 } from '../pages/page1/page1' ; import { Page2 } from '../pages/page2/page2' ; import { PageGmapAutocomplete } from '../pages/page-gmap-autocomplete/page-gmap-autocomplete' ; declare var google ; @ Component ( { templateUrl : 'app.html' } ) export class MyApp { @ ViewChild ( Nav ) nav : Nav ; rootPage : any = PageGmapAutocomplete ; pages : Array < { title : string ; component : any ; } > ; constructor ( public platform ) { this . initializeApp ( ) ; this . pages = [ { title : 'Page One' , component : Page1 } , { title : 'Page Two' , component : Page2 } , { title : 'Gmap Autocomplete' , component : PageGmapAutocomplete } ] ; } initializeApp ( ) { this . platform . ready ( ) . then ( ( ) => { StatusBar . styleDefault ( ) ; Splashscreen . hide ( ) ; } ) ; } openPage ( page ) { this . nav . setRoot ( page . component ) ; } }