离子选项卡菜单项隐藏

时间:2016-09-04 12:42:52

标签: javascript angularjs ionic-framework

<ion-tabs class="tabs-icon-top tabs-color-active-positive ">
<!-- Anasayfa Tab -->
  <div ng-if="showDiv=true">
    <ion-tab title="Home" icon-off="ion-ios-home-outline" icon-on="ion-ios-home" href="#/tab/chats">
        <ion-nav-view name="tab-chats"></ion-nav-view>
    </ion-tab>
  </div>
  <!-- Giriş Yap Tab -->
  <div ng-if="showDiv=true">
    <ion-tab title="Log-in" icon-off="ion-person-stalker" icon-on="ion-person-stalker" href="#/tab/login">
        <ion-nav-view name="tab-login"></ion-nav-view>
    </ion-tab></div>
  <!-- Kayıt Ol Tab -->
  <div ng-if="showDiv=true">
    <ion-tab title="sign-in" icon-off="ion-person-add" icon-on="ion-person-add" href="#/tab/register">
        <ion-nav-view name="tab-register"></ion-nav-view>
    </ion-tab>
  </div>
  <!-- Hakkımızda Tab -->
  <div ng-if="showDiv=false">
    <ion-tab title="Information" icon-off="ion-information" icon-on="ion-information-circled" href="#/tab/info" >
        <ion-nav-view name="tab-info"></ion-nav-view>
    </ion-tab>
  </div>
</ion-tabs>

我想将标签菜单项隐藏起来,登录并登录然后用户输入。

$scope.showDiv = "true";
console.log('fired');
$scope.showDiv = !$scope.showDiv;

我正在尝试,但它不起作用。

1 个答案:

答案 0 :(得分:3)

您可以使用&#34;隐藏&#34;隐藏离子标签。属性如下 -

<ion-tabs class="tabs-icon-top tabs-color-active-positive "> 
    <ion-tab hidden="{{condition}}" title="Home" icon-off="ion-ios-home-outline" icon-on="ion-ios-home" href="#/tab/chats">
        <ion-nav-view name="tab-chats"></ion-nav-view>
    </ion-tab>
    <ion-tab hidden="{{condition}}" title="Log-in" icon-off="ion-person-stalker" icon-on="ion-person-stalker" href="#/tab/login">
        <ion-nav-view name="tab-login"></ion-nav-view>
    </ion-tab>
</ion-tabs>