Slide 5
Slide 5 text
$watch optimizations
●
single $watch is fast actually…
●
deep $watch is slow, don’t overuse it
$scope.$watch("collection", fn, true);
●
Use $watchCollection instead of deep $watch
$scope.$watchCollection("collection", fn);
Note:
{{ expression }} ←→ $scope.$watch("expression", fn);
5