December 2014
Intermediate to advanced
346 pages
6h 14m
English
The equality comparator watcher can be a fickle beast when tuning the application for better performance. It's always best to avoid it when possible, but of course, that holds true until you actually need to deep watch a collection of large objects. The overhead of watching a large object is so cumbersome that sometimes distilling objects down to a subset for the purposes of comparison can actually yield performance gains.
The following is the naïve method of an exhaustive equality comparator watch:
$scope.$watch('bigObjectArray', function() {
// watch callback
}, true);Instead of watching the entire object, it is possible to call map() on a collection of large objects in order to extract only the components ...
Read now
Unlock full access