How to apply ng-class based on a DIV text - angularjs -
i have following ng-repeat in table;
<tbody> <tr ng-repeat="hour in workhours"> <td >{{hour}}:00 - {{hour+1}}:00</td> <td ng-class="{'full' : }" ng-click="checkslotavailability(hour, entry, joblength, data)" ng-repeat="entry in data.calendar" > {{entry.hoursavailable.includes(hour) ? 'available' : 'full'}} </td> </tr> </tbody> .full{ background-color: red; }
i want table cells display red there's 'full' text on cell. pairs 'full'
in ng-class
?
try using negation operator. want .full
class applied if entry.hoursavailable.includes(hour)
is false ( criteria full text appear)
ng-class="{'full' :!entry.hoursavailable.includes(hour) }"
Comments
Post a Comment