2016-09-28 86 views
0

我正在進行離子和angularjs項目。在顯示一個包含若干個徽章的標籤之一,我想徽章只出現如果這個數字是超過0僅在數字超過0時顯示徽章號碼

<ion-tab icon="ion-android-notifications" title="Notifications" href="#/tab/notifications" ng-app="starter" ng-controller="notifications_count" badge="total" badge-style="badge-assertive"> 
     <ion-nav-view name="list-notifications"></ion-nav-view> 
    </ion-tab> 
+0

試NG-if條件 –

回答

3
<ion-tab icon="ion-android-notifications" title="Notifications" href="#/tab/notifications" ng-app="starter" ng-controller="notifications_count" badge="total" ng-if="total>0" badge-style="badge-assertive"> 
    <ion-nav-view name="list-notifications"></ion-nav-view> 
</ion-tab>