【发布时间】:2015-08-13 01:18:07
【问题描述】:
嘿,Stackoverflow 的超级英雄们。我目前正在使用 angularjs 和 checklist-model 指令处理清单。我试图弄清楚当达到 x 数量的复选框时如何禁用所有未选中的框。
我正在从 json 文件中获取数据,因此我的复选框位于 ng-repeat 中。
现在我禁用所有复选框。当达到检查的 x 数时。不幸的是,用户应该能够更改已选择的内容。
<label ng-repeat="item in items | orderBy:item_position">
<h3>{{item.item_name}}</h3>
<p>{{item.item_position}}</p>
<!--checkbox -->
<input type="checkbox" ng-disabled="item.answers.length >= 12" checklist-model="item.answers" checklist-value="player">
【问题讨论】:
标签: javascript angularjs checkbox