How to hide the tab


#1

Is there a way to hide the tab in ionic2, I checked the api docs it did not provide any ways to hide the tab.
I tried using [hidden] but did not work:

<ion-tabs tabbarPlacement="bottom" preloadTabs="false" #paymentTabs>
            <ion-tab [root]="bikes" [rootParams]="fooId" tabTitle="bikes" tabIcon="pulse"></ion-tab>
            <ion-tab [root]="cars" tabTitle="cars" [rootParams]="fooId" tabIcon="analytics"></ion-tab>
            <ion-tab [root]="ships" tabTitle="ships" [rootParams]="fooId" tabIcon="card" ></ion-tab>
        </ion-tabs>

Is there a way to hide the tabs?


#2

[hidden] must work, probably theres a problem setting the condition.

Try with [hidden]=“true”

also you could try:

*ngIf=“false”


#3

Well, this will hide the tab contents but will not hide the tab name.


#4

I guess its not possible to hide the tab. We can just disable the contents of the tab


#5

As a user, I would find tabs appearing and disappearing (as opposed to enabling and disabling) to be disconcerting.


#6

Yes Its not a good idea to disable or hide and re enable the tabs its not a good ux practice


#7

Yes, I agree.

Any possible solution?


#8

Hi, there is a way to programatically hide tabs, for example when you go inside page, from a tab, but unfortunately I totally lost the code of it while in coding rush mode :frowning:

[hidden] doesn’t work for sure in Ionic 2. If I remember you have to go with more routes, and use conditions according to app-wide observables, like for example on current user.

I will also agree with @chandroiud, hiding a menu tab would be dangerous if it’s shown all over the app before.

Anyways, I don’t understand the rage about tabs, they might be for sure old-school, but if a UI/potential customer does old-school, there is no bad in that.