I'm starting to work with corner nights too, but can't handle it by making properties available through your javascript view model?
For example, there is a style field that changes according to the date fields (for example, the style returns style 1 if the difference is 10 days) and, hopefully, updates will be distributed to the screen through the angularjs binding.
I think the correct term for this is a computed property or computed property
EDIT
Not sure if this is what you are looking for, but see a script, for example, to calculate the date and change the style based on the properties of the view model (scope)
scope.diff and scope.col are 2 properties to bind to
http://jsfiddle.net/chrismoutray/wfjv6/
HTML
<script src="http://code.angularjs.org/0.10.4/angular-0.10.4.min.js" ng:autobind></script> <div ng:controller="ComputedPropertiesCtrl"> first date <input ng:model="firstdate"> second date <input ng:model="seconddate"> difference {{diff}} <div>when the difference is greater than 10 color changes to green</div> <div>eg set the second date to 15/01/2013</div> <div style="background-color:{{col}};"> State </div> </div>
Js
function ComputedPropertiesCtrl() { var scope = this; scope.firstdate = '01/01/2013'; scope.seconddate = '10/01/2013'; scope.data_before = []; scope.differenceInDays = function() { var dt1 = scope.firstdate.split('/'), dt2 = scope.seconddate.split('/'), one = new Date(dt1[2], dt1[1]-1, dt1[0]), two = new Date(dt2[2], dt2[1]-1, dt2[0]); var millisecondsPerDay = 1000 * 60 * 60 * 24; var millisBetween = two.getTime() - one.getTime(); var days = millisBetween / millisecondsPerDay; return Math.floor(days); }; scope.color = function() { return (scope.differenceInDays() > 10) ? 'green' : 'red'; }; scope.$watch('[firstdate, seconddate]', function(currScope,newVal,oldVal) { scope.data_before = oldVal; scope.diff = scope.differenceInDays(); }); scope.$watch('[firstdate, seconddate]', function(currScope,newVal,oldVal) { scope.data_before = oldVal; scope.col = scope.color(); }); }
CSS
h2 { position: fixed; right: 10px; top: 10px; color: red; background:white;z-index:1000; } input { width: 100px; } div { margin: 10px; padding: 10px; }