Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import { Component, ViewChild } from '@angular/core';
- import { Nav, App, Platform, LoadingController } from 'ionic-angular';
- import { StatusBar } from '@ionic-native/status-bar';
- import { SplashScreen } from '@ionic-native/splash-screen';
- import { AuthProvider } from '../../providers/auth';
- import { AboutPage } from '../about/about';
- import { TabsPage } from '../tabs/tabs';
- import { ContactPage } from '../contact/contact';
- @Component({
- selector: 'page-sidemenu',
- templateUrl: 'sidemenu.html'
- })
- export class SidemenuPage {
- @ViewChild(Nav) nav: Nav;
- tabsPage: any = TabsPage;
- pages: Array<{ title: string, component: any }>;
- constructor(
- public platform: Platform,
- public statusBar: StatusBar,
- public splashScreen: SplashScreen,
- private auth: AuthProvider,
- private loadingCtrl: LoadingController,
- public appCtrl: App) {
- this.pages = [
- { title: 'Lista de pagos', component: TabsPage },
- { title: 'Nosotros', component: AboutPage },
- { title: 'Contacto', component: ContactPage },
- ];
- }
- openPage(page) {
- this.nav.setRoot(page.component);
- }
- logout() {
- let loading = this.loadingCtrl.create({
- content: ''
- });
- loading.present();
- setTimeout(() => {
- this.auth.logout();
- loading.dismiss();
- }, 500);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement