<button ng-disabled="test()">按钮</button>angular.module('myApp', []).
controller('c',function($scope){ $scope.test=function(){ console.log('为什么打印两次'); return false; } })
拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...
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! ! !
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! ! !