Why does AngularJS execute function on every digest loop?
问题 I'm coming from Knockout and I'm trying to understand how Angular updates the scope. I'm a bit confused as to why a function defined on the scope (e.g. $scope.doStuff = function() ) gets executed on every single scope refresh. Plnkr link: http://plnkr.co/edit/YnvOELGkRbHOovAWPIpF?p=preview For example: HTML <div ng-controller="one"> <input type="text" ng-model="a"> {{b()}} </div> JS angular.module('test', []) .controller('one', ['$scope', function ($scope) { $scope.a = 'one'; $scope.b =