I'm building a toy job scheduling system using meteor.
Here's the controller where I pass a "shifts" collection:
angular.module('eamorr').controller('EamorrCtrl', ['$scope', '$meteor', function ($scope, $meteor) {
$scope.shifts = $meteor.collection(Shifts);
...
}]);
... to my .ng.html
:
<tr ng-repeat="shift in shifts">
...
<td>{{shift.unixTime_start*1000 | date:'yyyy-MM-dd'}}</td>
...
</tr>
Now, when shift.unixTime_start
is less than the current time, I want the whole row to have background-color:orange
and when shift.unixTime_start
is greater than the current time, I want the whole row to have background-color:green
.
Can anyone give me a tip as to how to do this neatly, cleanly and concisely?
I've been looking at doing a load of ng-if statements, etc. Do I have to use an interval? Check every 5 seconds and update the table accordingly? This doesn't seem the right way to me...