<button ng-disabled="test()">按钮</button>
angular.module('myApp', []).
controller('c',function($scope){
$scope.test=function(){
console.log('为什么打印两次');
return false;
}
})
天蓬老师2017-05-27 17:46:43
I reproduced your code, see: JSFiddle-Problem Reproduction
Angular’s dirty value check, for the specific reason, see: Understanding the Angular data binding process
I won’t go into details! ! !