<button ng-disabled="test()">按钮</button>
angular.module('myApp', []).
controller('c',function($scope){
$scope.test=function(){
console.log('为什么打印两次');
return false;
}
})
Copyright 2014-2025 https://www.php.cn/ All Rights Reserved | php.cn | 湘ICP备2023035733号
我把你的代码重现了一遍,参见:JSFiddle-问题重现
angular的脏值检查,具体的原因看:理解Angular数据绑定过程
不做赘述了!!!