【发布时间】:2017-11-01 15:34:31
【问题描述】:
我正在使用 Angular2 开发一个项目。我有一个名为品牌的列表,其中包含其他称为描述的列表。
此列表将创建复选框:
<div *ngFor="let brand of brands">
{{ brand.category }}
<div*ngFor="let description of brand.descriptions" >
<input type="checkbox" name="checkbox" />{{ description.value }}
</div>
</div>
我有两个文本框:
<input name="brand" />
<input name="description" />
<button>uncheck</button>
按钮事件将仅取消选中带有品牌和输入中提到的描述的复选框,而不会更改或重建列表,因为我需要保持复选框的状态正确。
有什么想法吗?
【问题讨论】: