Guest User

Untitled

a guest
Jul 17th, 2018
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.31 KB | None | 0 0
  1. ### app.component.ts
  2.  
  3. ```
  4. import { Component } from '@angular/core';
  5. import { Platform } from 'ionic-angular';
  6. import { StatusBar } from '@ionic-native/status-bar';
  7. import { SplashScreen } from '@ionic-native/splash-screen';
  8.  
  9. import { Storage } from '@ionic/storage';
  10. import { LoadingController } from 'ionic-angular';
  11.  
  12. import { TabsPage } from '../pages/tabs/tabs';
  13. import { WelcomeSlidePage } from '../pages/welcome-slide/welcome-slide';
  14.  
  15.  
  16. @Component({
  17. templateUrl: 'app.html'
  18. })
  19. export class MyApp {
  20. rootPage:any = TabsPage;
  21. loader: any;
  22.  
  23. constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public loadingCtrl: LoadingController, public storage: Storage) {
  24.  
  25. this.presentLoading();
  26.  
  27. platform.ready().then(() => {
  28.  
  29. this.storage.get('introShown').then((result) => {
  30.  
  31. if(result){
  32. this.rootPage = TabsPage;
  33. } else {
  34. this.rootPage = WelcomeSlidePage;
  35. this.storage.set('introShown', true);
  36. }
  37.  
  38. this.loader.dismiss();
  39.  
  40. });
  41.  
  42. statusBar.styleDefault();
  43. splashScreen.hide();
  44.  
  45.  
  46. });
  47.  
  48. }
  49.  
  50. presentLoading() {
  51.  
  52. this.loader = this.loadingCtrl.create({
  53. content: "Loading..."
  54. });
  55.  
  56. this.loader.present();
  57.  
  58. }
  59.  
  60.  
  61.  
  62. }
  63.  
  64. ```
Add Comment
Please, Sign In to add comment