我有以下ng-repeat
調用,它在前端顯示平坦的'AVAILABLE'或'FULL'。需要通過修改html來從$scope
中讀取更具動態性。
<tbody>
<tr ng-repeat="hour in workhours">
<td >{{hour}}:00 - {{hour+1}}:00</td>
<td ng-class="{'full' : !entry.HoursAvailable.includes(hour)}"
ng-click="checkSlotAvailability(hour, jobLength, entry, data)"
ng-repeat="entry in data.calendar" >
{{entry.HoursAvailable.includes(hour) ? 'AVAILABLE' : 'FULL'}}
</td>
</tr>
</tbody>
在地方的 '可用',我想讀$scope.data.response
在controller.js響應
如何'$ scope.data.response'外觀喜歡? –
它只是一個字符串,例如'$ scope.data.response ='AVAILABLE''。基本上將邏輯移至控制器。 –