Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ### app.component.ts
- ```
- 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();
- }
- }
- ```
Add Comment
Please, Sign In to add comment