test(tabs): adds show test

references #6412
This commit is contained in:
Manu Mtz.-Almeida
2016-10-13 23:59:23 +02:00
parent f9aa12e634
commit 060748b4cf
2 changed files with 6 additions and 3 deletions

View File

@@ -31,6 +31,7 @@ export class ChatPage {
templateUrl: './tabs.html'
})
export class TabsPage {
showTab: boolean = false;
@ViewChild(Tabs) tabs: Tabs;
@@ -42,7 +43,9 @@ export class TabsPage {
});
}
onTabChange() {
onTabChange(tab: Tab) {
this.showTab = tab.index !== 1;
// wired up through the template
// <ion-tabs (ionChange)="onTabChange()">
console.log('onTabChange');

View File

@@ -1,7 +1,7 @@
<ion-tabs preloadTabs="false" (ionChange)="onTabChange()">
<ion-tabs preloadTabs="false" (ionChange)="onTabChange($event)">
<ion-tab tabTitle="Recents" tabIcon="call" root="Tab1Page1" swipeBackEnabled="true"></ion-tab>
<ion-tab tabTitle="Favorites" tabIcon="star" root="Tab2Page1"></ion-tab>
<ion-tab tabTitle="Settings" tabIcon="settings" root="Tab3Page1"></ion-tab>
<ion-tab tabTitle="Chat" tabIcon="chatbubbles" (ionSelect)="chat()"></ion-tab>
<ion-tab tabTitle="Chat" tabIcon="chatbubbles" (ionSelect)="chat()" [show]="showTab"></ion-tab>
</ion-tabs>