daily pastebin goal
45%
SHARE
TWEET

sidemenu.ts

a guest Feb 13th, 2018 54 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import { Component, ViewChild } from '@angular/core';
  2. import { Nav, App, Platform, LoadingController } from 'ionic-angular';
  3. import { StatusBar } from '@ionic-native/status-bar';
  4. import { SplashScreen } from '@ionic-native/splash-screen';
  5. import { AuthProvider } from '../../providers/auth';
  6.  
  7. import { AboutPage } from '../about/about';
  8. import { TabsPage } from '../tabs/tabs';
  9. import { ContactPage } from '../contact/contact';
  10.  
  11. @Component({
  12.   selector: 'page-sidemenu',
  13.   templateUrl: 'sidemenu.html'
  14. })
  15. export class SidemenuPage {
  16.   @ViewChild(Nav) nav: Nav;
  17.  
  18.   tabsPage: any = TabsPage;
  19.  
  20.   pages: Array<{ title: string, component: any }>;
  21.  
  22.   constructor(
  23.     public platform: Platform,
  24.     public statusBar: StatusBar,
  25.     public splashScreen: SplashScreen,
  26.     private auth: AuthProvider,
  27.     private loadingCtrl: LoadingController,
  28.     public appCtrl: App) {
  29.    
  30.     this.pages = [
  31.       { title: 'Lista de pagos', component: TabsPage },
  32.       { title: 'Nosotros', component: AboutPage },
  33.       { title: 'Contacto', component: ContactPage },
  34.     ];
  35.  
  36.   }
  37.  
  38.   openPage(page) {
  39.     this.nav.setRoot(page.component);
  40.   }
  41.  
  42.   logout() {
  43.     let loading = this.loadingCtrl.create({
  44.       content: ''
  45.     });
  46.     loading.present();
  47.     setTimeout(() => {
  48.       this.auth.logout();
  49.       loading.dismiss();    
  50.     }, 500);    
  51.   }
  52. }
RAW Paste Data
Top