如果 bool 变量(从后端返回)为 true,我需要禁用按钮。
这是我的 Angular Controller 上的不完整功能,如何更改我的 Controller 和 HTML 按钮才能使其工作?
$scope.flagInLavorazione = function (flagInLavorazione) {
if (flagInLavorazione === true){
// What to add here?
}
}
最佳答案
您正在寻找ng-disabled
。只需从 Controller 为其分配一个属性即可。当它为true
时,该元素将被禁用。使用后端的值填充该属性。
关于javascript - 如果满足条件,如何禁用 Angular Controller 中的按钮?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/54946486/