Hide ion-tab for non-logged

How can I hide ion-tab for non-logged users and display it automatically when someone is logged?


you can use [hidden]=true on any html tag Ionic 2 how to hide show highchart div?

Best regards, anna-liebr

thanks @anna_liebt
but if i add [hidden]=true to:

<ion-tab [root]="tab2Root" [hidden]="true" tabTitle="News" tabIcon="ios-timer-outline"></ion-tab>

“News” is still visible on tabs list, but when I click on it I see blank ion-content.
I need to hide “News” in <ion-tabs>

damn, use show instead of hidden.

<ion-tab [root]="tab2Root" show="false" tabTitle="News" tabIcon="ios-timer-outline"></ion-tab>

Best regrads, anna-liebt

Hello, you can also use the *NgIf directive

In html :
<ion-tab [root]="tab2Root" *ngIf="isVisible" tabTitle="News" tabIcon="ios-timer-outline"></ion-tab>

In ts:
public isVisible boolean=false;

When the user is connected, add this in your code :

excuse me, how can I change the show property to true at runtime?
Is it possible?


I’ve used a function that returns true or false:

<ion-tab [root]="tab3Root" tabTitle="{{ 'Directories' | translate }}" tabIcon="document" show="{{isSupplier()}}"></ion-tab>