我正在研究离子和angularjs项目。在其中一个选项卡中显示一个包含数字的徽章,我希望徽章仅在数字大于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 :(得分: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>