Skip to content

Instantly share code, notes, and snippets.

@JaimeSarrion
Created July 31, 2017 10:51
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 JaimeSarrion/ede8f8293aee3c78e7d3d822848d84d1 to your computer and use it in GitHub Desktop.
Save JaimeSarrion/ede8f8293aee3c78e7d3d822848d84d1 to your computer and use it in GitHub Desktop.
.html
<ion-tabs [selectedIndex]="myIndex">
<ion-tab [root]="tab1Root" tabTitle="Inicio" tabIcon="home"></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>
.ts
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';
myIndex : number;
constructor( public navParams: NavParams) {
this.myIndex = this.navParams.data.tabIndex || 0;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment