I have a table tr with an ng-repeat where I colored the background of the row based on time. The colorClassFilter returns a class value based on the time passed in:
<tr ng-repeat="object in objects" class={{object.time | colorClassFilter}}>
<td>...
<td>...
</tr>
That worked great, but now I want to add a checkbox that allows the user to turn on/off the coloring, bound to a Boolean called useRowColors. I want to use the ng-class conditionally but not sure how to do that. This is what I tried and it doesn't work.
<tr ng-repeat="object in objects" ng-class="{ object.time | colorClassFilter : useRowColors }">
EDIT: After reading response by jitch_it (which didn't work), it led me to try this:
<tr ng-repeat="object in objects" ng-class="{'{{object.time | colorClassFilter}}' : useRowColors}">
This is what it produces in the DOM for useRowColors true:
<tr class="ng-scope ''" ng-class="{'rowColorBlue' : useRowColors}" ng-repeat="object in objects" >
Instead of this (which is what I would expect to see):
<tr class="rowColorBlue" ng-class="{'rowColorBlue' : useRowColors}" ng-repeat="object in objects" >
I'm guessing I need another level of compiling thru angular somehow?? What am I missing?