{
$scope.editable = true;
$scope.NewEmployee = function () {
$scope.editable = false;
};
$scope.EditEmployee = function () {
$scope.editable = false;
$scope.Employee.edit = true;
};
$scope.Cancel = function () {
$scope.editable = true;
};
}
<button ng-click="NewEmployee()"></button>
<button ng-click="EditEmployee()" ></button>
<button ng-click="Save()" ng-disabled="editable"></button>
<button ng-class="Cancel()" ng-disabled="editable"></button>
当只有 NewEmployee() 时它起作用
但我添加了 EditEmployee() Save() Cancel() 其中之一它不起作用
最佳答案
您的代码中有一个 TYPO 错误
<button ng-class="Cancel()" ng-disabled="editable"></button>
ng-class="Cancel()"
这应该像 ng-click="Cancel()"
关于javascript - angularJs ng-禁用不工作,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/37251507/