wangtengyu
2018-11-06 a5a6487bd568fda30c7204ef3e3b7a2ed0a9019c
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
import { Component, ViewChild } from '@angular/core';
import { Platform, Nav } from 'ionic-angular';
import { StatusBar } from '@ionic-native/status-bar';
import { SplashScreen } from '@ionic-native/splash-screen';
import { PlatformService } from 'kl/core';
 
@Component({
  templateUrl: 'app.html'
})
export class MyApp {
  rootPage: any = 'maintabs';
  @ViewChild(Nav) nav: Nav;
 
  constructor(
    platform: Platform,
    private statusBar: StatusBar,
    private splashScreen: SplashScreen,
    private platformService: PlatformService) {
    platform.ready().then(() => {
      this.splashScreen.hide();
 
      if (platform.is('ios') || platform.is('android')) {
        this.statusBar.styleDefault();
      }
      // 注册返回按键事件
      this.platformService.rootNav = this.nav;
      this.platformService.registerBackButton();
    });
  }
}