Skip to content

Instantly share code, notes, and snippets.

/menu-tabs.ts Secret

Created July 31, 2017 12:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save anonymous/e02b656188f8b051040f3c85e5604887 to your computer and use it in GitHub Desktop.
Save anonymous/e02b656188f8b051040f3c85e5604887 to your computer and use it in GitHub Desktop.
import { Component } from '@angular/core';
import { IonicPage, NavController, NavParams } from 'ionic-angular';
@IonicPage({
name: 'menu-tabs-page'
})
@Component({
selector: 'page-menu-tabs',
templateUrl: 'menu-tabs.html',
})
export class MenuTabsPage {
tab1Root : any = 'home-page';
tab2Root : any = 'tarjeta-page';
tab3Root : any = 'establecimientos-page';
tab4Root : any = 'listado-ofertas-page';
showTabs: boolean = true;
myIndex : number;
constructor( public navParams: NavParams) {
this.myIndex = this.navParams.data.tabIndex || 0;
}
hideTabs() {
this.showTabs = false;
}
}
<ion-tabs [selectedIndex]="myIndex" *ngIf="showTabs">
<ion-tab [root]="tab1Root" tabTitle="Inicio" tabIcon="home" (ionSelect)="hideTabs()"></ion-tab>
<ion-tab [root]="tab2Root" tabTitle="Tarjeta" tabIcon="card"></ion-tab>
<ion-tab [root]="tab3Root" tabTitle="Comercios" tabIcon="basket"></ion-tab>
<ion-tab [root]="tab4Root" tabTitle="Ofertas" tabIcon="pricetag"></ion-tab>
</ion-tabs>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment