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

Popular posts from this blog

php - Vagrant up error - Uncaught Reflection Exception: Class DOMDocument does not exist -

vue.js - Create hooks for automated testing -

Add new key value to json node in java -