JS
$scope.change = function(event){
event.target.innerHTML = "connecting <i class='fa fa-refresh fa-spin'
aria-hidden='true'></i>";
event.target.setAttribute("ng-disabled",true);
}
HTML
<button class="btn-invite" ng-click="change($event)">Connect <i class="fa fa-plug" aria-hidden="true"></i> </button>
没有禁用按钮?
答案 0 :(得分:1)
在控制器内更改禁用禁用
$scope.change = function(event){
event.target.innerHTML = "connecting <i class='fa fa-refresh fa-spin'
aria-hidden='true'></i>";
event.target.setAttribute("disabled",true);
}
答案 1 :(得分:0)
从角度ng-点击你不能直接调用javascript函数你必须在控制器中定义并从angular js html调用 像是
控制器代码:
$scope.change = function (event) {
event.target.innerHTML = "connecting <i class='fa fa-refresh fa-spin'
aria - hidden = 'true' > < /i>";
event.target.setAttribute("ng-disabled", true);
}