{{item.na...">

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


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


source


Just write ng-disabled = "true"

in the function where u want to disable your button



+3


source







All Articles