Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Disable buttons inside ng repeat

How can I disable all the buttons inside ng-repeat? Here's my code..

<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="isDisabled">Submit</button></div>
like image 428
forgottofly Avatar asked Jun 22 '26 20:06

forgottofly


2 Answers

Just write ng-disabled = "true" in function where u want to disable your button

like image 88
Mohaimin Moin Avatar answered Jun 25 '26 10:06

Mohaimin Moin


If isDisabled is a property of the items in the array use:

<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="item.isDisabled">Submit</button></div>
like image 30
user3063182 Avatar answered Jun 25 '26 12:06

user3063182



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!