Skip to content

Instantly share code, notes, and snippets.

@geykel
Created July 12, 2017 23:38
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save geykel/ec273d9f40b27d5526ff4f5222834c11 to your computer and use it in GitHub Desktop.
Save geykel/ec273d9f40b27d5526ff4f5222834c11 to your computer and use it in GitHub Desktop.
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 { AuthService } from '../providers/auth-service';
import { SignInPage } from '../pages/signin/signin';
import { HomePage } from '../pages/home/home';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage: any = SignInPage;
constructor(
platform: Platform,
statusBar: StatusBar,
splashScreen: SplashScreen,
authService: AuthService) {
if (authService.authenticated) {
this.rootPage = SignInPage;
} else {
this.rootPage = HomePage;
}
platform.ready().then(() => {
statusBar.styleDefault();
splashScreen.hide();
});
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment