【发布时间】:2017-02-24 13:11:22
【问题描述】:
我有一个表格,第一列是复选框
<table *ngIf="Results && Results.length">
<thead>
<tr>
<th>
<input type="checkbox" name="all" />
</th>
<th>Location</th>
</tr>
</thead>
<tbody>
<tr *ngFor="let Result of Results; let i = index">
<td>
<input type="checkbox" name="size1" value="{{Result.id}}" [checked]="Result.State" />
</td>
<td>{{Result.Column1}}</td>
</tr>
</tbody>
</table>
考虑到我在 Result.State 绑定中有来自数据库的数据是否已选中复选框,我如何在 Angular2 中实现检查全部并取消选中全部。 (这是有效的)。 我需要检查/取消检查用户是否手动输入以及是否检查了从数据库返回的所有项目。
【问题讨论】:
标签: angular