When to use $watch or ng-change in Angularjs
问题 When should I use angular $watch functions and when use ng-change angularjs directive? To me, they both can do the same. Are there any differences or usage patterns between them? 回答1: They are not the same, clearly. One is used solely in the controller; the other is a directive on an input element. But even in their application they differ. When you use $watch the watched expression will be evaluated on every digest cycle, and if there is a change, the handler is invoked. With ng-change , the