import { Component } from '@angular/core' ; import { Platform } from 'ionic-angular' ; import { StatusBar } from '@ionic-native/status-bar' ; import { SplashScreen } from '@ionic-native/splash-screen' ; import { TabsPage } from '../pages/tabs/tabs' ; import { OAuthService } from 'angular-oauth2-oidc' ; import { LoginPage } from '../pages/login/login' ; @ Component ( { templateUrl : 'app.html' } ) export class MyApp { rootPage : any = TabsPage ; constructor ( platform , statusBar , splashScreen , oauthService ) { if ( oauthService . hasValidIdToken ( ) ) { this . rootPage = TabsPage ; } else { this . rootPage = LoginPage ; } platform . ready ( ) . then ( ( ) => { statusBar . styleDefault ( ) ; splashScreen . hide ( ) ; } ) ; } }