Angular Js Day2 - $ watch $watchcollection, $watchgroup , ng-change
$watch keeps track of a variable and its value <div ng-controller="mycontroller"> <input ng-model="a"> <div> {{ b }}</div> </div> app.controller('mycontroller',function(){ $scope.a=1; $scope.b=2; }) whenever a databinding with the scope variable is created , a $watch will automatically be created by the angular js framework $watch -a:1 and $watch -b:2, And this will be used by the digest cycle . Since C is not used in any databinding , so $watch is not created for variable c. If the value gets changes for those variable, angular performs necessary updates to the DOM elements With the help pg $watch custom functions can be created which are called $watchListeners and this gets executed as soon a the value of the variables is changed They are mainly used for databinding and angular Js constantly uses watchers behind the scene number of watchers should be kept less the 2000 There are number of ways to get...