编程语言
首页 > 编程语言> > javascript – 禁用ng repeat内的按钮

javascript – 禁用ng repeat内的按钮

作者:互联网

如何禁用ng-repeat中的所有按钮?
这是我的代码..

<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="isDisabled">Submit</button></div>

解决方法:

如果isDisabled是数组中项目的属性,则使用:

<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="item.isDisabled">Submit</button></div>

标签:javascript,angularjs,ng-repeat
来源: https://codeday.me/bug/20190830/1767048.html