Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, ViewChild } from '@angular/core';
- import { Nav, Platform } from 'ionic-angular';
- import { StatusBar } from '@ionic-native/status-bar';
- import { SplashScreen } from '@ionic-native/splash-screen';
- @Component({
- templateUrl: 'app.html'
- })
- export class MyApp {
- @ViewChild(Nav) nav: Nav;
- rootPage: any = 'LoginPage';
- pages: Array<{title: string, component: any}>;
- constructor(public platform: Platform, public statusBar: StatusBar, public splashScreen: SplashScreen) {
- this.initializeApp();
- // used for an example of ngFor and navigation
- }
- initializeApp() {
- this.platform.ready().then(() => {
- // Okay, so the platform is ready and our plugins are available.
- // Here you can do any higher level native things you might need.
- this.statusBar.styleDefault();
- this.splashScreen.hide();
- });
- }
- logout() {
- this.nav.setRoot('LoginPage');
- }
- go(page){
- this.nav.setRoot(page);
- }
- test(){
- alert('Opção de demonstração');
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement