import { Component , ViewChild } from '@angular/core' ; import { Nav , Platform } from 'ionic-angular' ; import { Splashscreen , StatusBar } from 'ionic-native' ; import { DEFAULT_PAGE , MenuItem , DrawerLinks } from '../components' ; import strings from '../strings' ; @ Component ( { templateUrl : 'app.template.html' } ) export class Application { @ ViewChild ( Nav ) public nav : Nav ; public rootPage : any = DEFAULT_PAGE ; public get Text ( ) : any { return strings ; } public pages : MenuItem [ ] = DrawerLinks ; public constructor ( platform ) { platform . ready ( ) . then ( ( ) => this . onReady ( ) ) ; } private onReady ( ) { StatusBar . styleDefault ( ) ; Splashscreen . hide ( ) ; } param { MenuItem } page return { void } public openPage ( page ) { if ( page . component ) { if ( ! page . home ) this . nav . push ( page . component ) ; else this . rootPage = page . component ; } else if ( page . link ) window . open ( page . link , '_system' ) ; else if ( page . action ) page . action ( ) ; } }