我正在尝试将Angular 1应用程序转换为Angular 2.通过锯齿状的布尔数组循环(boolean[][]).我正在checkboxes使用以下代码进行渲染:
<div *ngFor="#cell of CellData; #parentIndex = index">
<input *ngFor="#col of cell; #childIndex = index" type="checkbox" [(ngModel)]="CellData[parentIndex][childIndex]" />
</div>
Run Code Online (Sandbox Code Playgroud)
复选框显示正确,但是,如果我选中一个复选框,也会选中右侧的复选框.
这个逻辑在Angular 1应用程序中工作正常,所以我不确定这是否与我使用ngModel的方式或Angular 2的问题有关.
任何帮助将非常感激
angular ×1