Advertisement
juliosantanna75

Untitled

Jan 16th, 2018
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
HTML 1.04 KB | None | 0 0
  1. import { Component, ViewChild } from '@angular/core';
  2. import { Nav, Platform } from 'ionic-angular';
  3. import { StatusBar } from '@ionic-native/status-bar';
  4. import { SplashScreen } from '@ionic-native/splash-screen';
  5.  
  6. @Component({
  7.   templateUrl: 'app.html'
  8. })
  9. export class MyApp {
  10.   @ViewChild(Nav) nav: Nav;
  11.  
  12.   rootPage: any = 'LoginPage';
  13.  
  14.   pages: Array<{title: string, component: any}>;
  15.  
  16.   constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
  17.     this.initializeApp();
  18.  
  19.     // used for an example of ngFor and navigation
  20.  
  21.  
  22.   }
  23.  
  24.   initializeApp() {
  25.     this.platform.ready().then(() => {
  26.       // Okay, so the platform is ready and our plugins are available.
  27.       // Here you can do any higher level native things you might need.
  28.       this.statusBar.styleDefault();
  29.       this.splashScreen.hide();
  30.     });
  31.   }
  32.  
  33.   logout() {
  34.     this.nav.setRoot('LoginPage');
  35.   }
  36.   go(page){
  37.     this.nav.setRoot(page);
  38.   }
  39.   test(){
  40.     alert('Opção de demonstração');
  41.   }
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement