Alexander Kundurdjiev Alexander Kundurdjiev - 5 months ago 8
AngularJS Question

pass input attribute data to other input function parameter - angular

Is it possible to pass ng-disabled data to other input function parameter:

<div ng-repeat="item in properties">
<input type="checkbox" ng-click="checkDisable(isDisable)">
<input type="checkbox" ng-disabled="properties[$index].isDisabled">
</div>


plunkr: here

Answer

Use the item value in the loop

<div ng-repeat="item in properties track by $index">
      <input type="checkbox" ng-click="checkDisable(item.isDisabled)">
       <input type="checkbox" ng-disabled="item.isDisabled">
 </div>

Plunker