如何禁用ng-repeat中的所有按钮? 这是我的代码..
<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="isDisabled">Submit</button></div>
答案 0 :(得分:3)
只需在你想要禁用按钮的功能中写ng-disabled = "true"
答案 1 :(得分:2)
如果isDisabled是数组中项目的属性,则使用:
<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="item.isDisabled">Submit</button></div>