samedi 26 janvier 2019

Only check the checkbox if the value of ngModel is true

When my checkbox is clicked the value of my ngModel produto.checked is set to true, but in a moment this value is changed to false without a click in the checkbox. How can i make my checkbox only check/uncheck according by my ngModel?

I try something like:

<tr *ngFor="let produto of sortedDataProduto; let i = index">
   <input [checked]="produto.checked" [(ngModel)]="produto.checked" name="checkedproduto" type="checkbox">
</tr>




Aucun commentaire:

Enregistrer un commentaire