How Angular $scope.$watch works?

This question already has an answer here:

  • How does data binding work in AngularJS? 13 answers

  • 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

    上一篇: AngularJS如何“倾听”模型中的变化?

    下一篇: $ Angular $ scope。$ watch如何工作?