Disable buttons inside ng repeat
How can I disable all buttons inside ng-repeat? Here is my code ..
<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="isDisabled">Submit</button></div>
+3
forgottofly
source
to share
2 answers
If isDisabled is a property of the elements in an array, use:
<div ng-repeat="item in array"> {{item.name}}<button type="button" ng-click="save()" ng-disabled="item.isDisabled">Submit</button></div>
+2
user3063182
source
to share
Just write ng-disabled = "true"
in the function where u want to disable your button
+3
Mohaimin moin
source
to share