我的Ionic应用程序中有一个手风琴列表,如下所示:
在黑色方块的地方,我希望有一个绿色(或任何颜色)LED类型看起来按钮/符号,如果已经观看了特定的练习,将会显示,基本上就像一个指示器。
此手风琴列表的代码如下:
<ion-view view-title="Trainingsplan">
<ion-content class="has-header">
<div ng-if="authenticated == true">
<ion-list>
<div ng-repeat="day in days"><br>
<div class="item item-icon-left" ng-click="toggleGroup(day)" ng-class="{active: isGroupShown(day)}">
<i class="icon icon-accessory" ng-class="isGroupShown(day) ? 'ion-minus' : 'ion-plus'"></i>
{{day.name}}
</div>
<a class="item item-icon-left item-accordion" ng-show="isGroupShown(day)" ng-repeat="exercise in day.exercises" type="item-text-wrap"
href="#/tab/plan/{{exercise.id}}">
{{exercise.name}}
</a>
</div>
</ion-list>
</div>
<div ng-if="authenticated!=true">Fail</div>
</ion-content>
</ion-view>
我怎么能做到这一点?
答案 0 :(得分:1)
我是这样做的:
<ion-list>
<div ng-repeat="day in days"><br>
<div class="item item-icon-left" ng-click="toggleGroup(day)" ng-class="{active: isGroupShown(day)}">
<i class="icon icon-accessory" ng-class="isGroupShown(day) ? 'ion-minus' : 'ion-plus'"></i>
{{day.name}}
</div>
<a class="item item-icon-left item-accordion" ng-show="isGroupShown(day)" ng-repeat="exercise in day.exercises" type="item-text-wrap"
href="#/tab/plan/{{exercise.id}}">
{{exercise.name}}
<!-- Trial LED -->
<span style="float:right;"><i ng-show="isWatched" class="ion-checkmark-round"></i></span>
</a>
</div>
</ion-list>