将输入属性数据传递给其他输入函数参数 - angular

时间:2016-07-06 11:50:55

标签: javascript angularjs ng-repeat

是否可以将禁用ng的数据传递给其他输入函数参数:

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

plunkr:here

1 个答案:

答案 0 :(得分:1)

使用循环中的项目值

<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