2016-04-01 104 views
0

我在離子的應用程序有一個可摺疊列表,它看起來像以下:離子手風琴列表

enter image description here

當時我想有一個綠色(或任何顏色)黑色方形的地方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> 
     &nbsp; 
     {{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> 

我怎樣才能做到這一點?

回答

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> 
     &nbsp; 
     {{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>