I would use $watch
to listen on data
.
See docs here
Generally $watch
with flag true
does deep compare.
Something like (hope you can convert it to coffee):
$scope.$watch(function () {
return$scope.data;
},
function (newValue, oldValue) {
// here you can write any action
}, true);