I have the following checkbox with a repeat structure:
<div *ngFor="let tela of telas" class="custom-control custom-checkbox check">
<input type="checkbox" id="{{tela.nome_tela}}" [(ngModel)]="operador.permissao_telas" name="{{tela.id}}" class="custom-control-input" checked>
<label class="custom-control-label" for="{{tela.nome_tela}}">{{tela.nome_tela}}</label>
</div>
This is my template:
export class Operador{
id: number;
nome: string;
permissao_telas: number[];
}
In my component I do:
operador:Operador = new Operador();
The problem is that when I click on some check, all other checks are selected as well.
I've tried indexing and it did not work either.