Advertisement
Guest User

Untitled

a guest
Jun 25th, 2019
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.39 KB | None | 0 0
  1. app.component.ts
  2.  
  3. import { Component, ViewChild } from '@angular/core';
  4. import { Platform, NavController } from 'ionic-angular';
  5. import { StatusBar } from '@ionic-native/status-bar';
  6. import { SplashScreen } from '@ionic-native/splash-screen';
  7.  
  8. import { Storage } from '@ionic/Storage';
  9. import { HomePage } from '../pages/home/home';
  10. import { LoginPage } from '../pages/login/login';
  11. import { RegisterPage } from '../pages/register/register';
  12.  
  13. @Component({
  14. templateUrl: 'app.html'
  15. })
  16. export class MyApp {
  17. _platform: Platform;
  18. public get platform(): Platform {
  19. return this._platform;
  20. }
  21. public set platform(value: Platform) {
  22. this._platform = value;
  23. }
  24. @ViewChild('content') nav: NavController;
  25. rootPage: any;
  26. initialization: any;
  27. initializationApp: any;
  28. Platform: any;
  29. statusBar: any;
  30. splashScreen: any;
  31. Storage: any;
  32.  
  33. constructor(
  34. public platform: Platform,
  35. public StatusBar: StatusBar,
  36. public SplashScreen: SplashScreen,
  37. private storage: Storage) {
  38. this.initializationApp();
  39. }
  40. initializeApp() {
  41. this.platform.ready().then(() => {
  42. this.statusBar.styleDefault();
  43. this.splashScreen.hide();
  44.  
  45. });
  46.  
  47. this.storage.get('session_storage').then((res) => {
  48. if (res == null) {
  49. this.rootPage = LoginPage;
  50. } else {
  51. this.rootPage = HomePage;
  52. }
  53. });
  54.  
  55. }
  56. }
  57.  
  58.  
  59. versão ionic 3.9.5
  60. angular: 5.2.11
  61. node: 10.15.3
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement