I am working on a project using Ionic 2 and I have implemented multiple tabs in the application. However, I need to find a way to hide the top tab when the user clicks on the bottom tabs menu icon.
- Here is my Plunker for your reference.
My goal is to make the above tab disappear when the user clicks on the bottom tab menu apps icon. In AngularJS, I could achieve this by using ng-hide
, but I am unsure how to do it in Ionic 2.
Upon clicking the tab menu apps icon
:
<ion-tabs tabs-only>
<ion-tab tabIcon="apps" [root]="tab3Root"></ion-tab>
</ion-tabs>
The above tab should be hidden
<ion-tabs tabs-only2 tabbar>
<ion-tab [root]="tab1Root" tabTitle="Tab 1" tabIcon="pulse"></ion-tab>
<ion-tab [root]="tab2Root" tabTitle="Tab 2" tabIcon="pulse"></ion-tab>
</ion-tabs>
Details of my multiple tab elements:
<ion-tabs tabs-only>
<ion-tab tabIcon="apps" [root]="tab3Root"></ion-tab>
</ion-tabs>
<ion-tabs tabs-only2 tabbar>
<ion-tab [root]="tab1Root" tabTitle="Tab 1" tabIcon="pulse"></ion-tab>
<ion-tab [root]="tab2Root" tabTitle="Tab 2" tabIcon="pulse"></ion-tab>
</ion-tabs>
If you have a solution, please update the Plunker.