我给出了一个复选框网格,每当我尝试单击任何复选框时,它总是通过相同的复选框ng-click
HTML
<tr ng-repeat="partecipant in current_event.partecipants">
<td class="user_cell"><font class="user_name">{{(partecipant}}</font><span class="arrow"></td>
<td class="checkbox_cell" ng-repeat="proposed_time in current_event.proposed">
<input type="checkbox" class="toggle" ng-checked="isChecked(partecipant, proposed_time)" ng-true-value="true" ng-false-value="false" ng-click="addResponse(partecipant, proposed_time)" ng-disabled="userProfile.webid != partecipant" name="thing" id="thing"><label for="thing">
</td>
</tr>
ng-checked
:工作正常,相应地检查复选框
ng-click
: 不工作,它总是传递第一个值proposed_time
ng-disabled
:不工作,都启用了,当它们应该只启用一行时userProfile.webid == partecipant
任何帮助表示赞赏。提前致谢。
编辑
解决了!
错误name="thing" id="thing"
在于使复选框具有相同的名称和 ID,因此我动态命名它们。