我有一个组件,它注入一个子组件,它是一个辅助组件.在父组件中,我有一个NgFor
,它复制子组件,在子组件中,我有另一个ngfor
,它创建一些复选框.
问题是,当我只选中一个框时,它也会选中另一个组中的同一个框.我怎么才能解决它呢?
父组件:
<div class="bloco-bilhete" id="bilhete1" style="padding: 15px" *ngFor="let divs of div">
<app-checkbox [Itens]="Listdays" (ItensReturn)="setDayReturn($event)"</app-checkbox>
</div>
子元素:
<div class="flex-container">
<div class="flex-filho" *ngFor="let i of Itens; index as n">
<input id="checkAceite{{n}}Div{{Div}}" class="form-check-input checbox-espaco" type="checkbox" [checked]="i.value" (change)="i.value = !i.value">
<label for="checkAceite{{n}}Div{{Div}}" style="font-size: 12pt">{{i.nome}}</label>
</div>
</div>
我希望支票不要在其他区块重复.