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 { Storage } from '@ionic/storage';
import { LoadingController } from 'ionic-angular';
import { TabsPage } from '../pages/tabs/tabs';
import { WelcomeSlidePage } from '../pages/welcome-slide/welcome-slide';
@Component({
templateUrl: 'app.html'
})
export class MyApp {
rootPage:any = TabsPage;
loader: any;
constructor(platform: Platform, statusBar: StatusBar, splashScreen: SplashScreen, public loadingCtrl: LoadingController, public storage: Storage) {
this.presentLoading();
platform.ready().then(() => {
this.storage.get('introShown').then((result) => {
if(result){
this.rootPage = TabsPage;
} else {
this.rootPage = WelcomeSlidePage;
this.storage.set('introShown', true);
}
this.loader.dismiss();
});
statusBar.styleDefault();
splashScreen.hide();
});
}
presentLoading() {
this.loader = this.loadingCtrl.create({
content: "Loading..."
});
this.loader.present();
}
}
Last active
July 20, 2018 03:10
-
-
Save Ademking/54aaf0836039e98f1ee937b51015db46 to your computer and use it in GitHub Desktop.
π Ionic 3 : How to make welcome page with Storage
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment