javascript - Angularjs: Pulling display data from $scope scenario -
i have following ng-repeat
call displays flat 'available' or 'full' on front end. need make more dynamic modifying html read $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>
in place of 'available', want read response $scope.data.response
in controller.js
you can
<span ng-if="entry.hoursavailable.includes(hour)"> {{ data.response }} </span> <span ng-if="!entry.hoursavailable.includes(hour)"> full </span>
Comments
Post a Comment