lundi 28 octobre 2019

shouldn't uncheck checkbox in certain conditions

<input type="checkbox" [(ngModel)]="rowData.forA">  // checkbox A
<input type="checkbox" [(ngModel)]="rowData.forB">  // checkbox B
<input type="checkbox" [(ngModel)]="rowData.forC">  // checkbox C

I have these checkbox. And a model:

class Book {
  name: string;
  forA: boolean;
  forB: boolean;
  forC: boolean;
}

forA forB forC mean the book should be used in condition A, condition B or condition C.

In some conditions, if checkbox A is checked, and it's used in a kind of condition A, you cannot uncheck it. how to do that?




Aucun commentaire:

Enregistrer un commentaire