javascript - Why is it printed twice?
高洛峰
高洛峰 2017-05-27 17:44:43
0
1
1110

<button ng-disabled="test()">按钮</button>
angular.module('myApp', []).

controller('c',function($scope){
    $scope.test=function(){
        console.log('为什么打印两次');
        return false;
    }
})

高洛峰
高洛峰

拥有18年软件开发和IT教学经验。曾任多家上市公司技术总监、架构师、项目经理、高级软件工程师等职务。 网络人气名人讲师,...

reply all(1)
Peter_Zhu

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! ! !

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template