How Angular $scope.$watch works?
This question already has an answer here:
Angular works by keeping track of the old values of your model data properties, and checking the current values against them after various triggers. So it detects the changes by doing the comparisons. You can find the details in the Runtime section of this page. (I didn't link directly to the Runtime section because that page currently uses the Bootstrap navbar at the top, which has a bug where it hides the first couple of lines of content when you link to a fragment.)
链接地址: http://www.djcxy.com/p/23112.html