I have an Array of mat-checbkox, where user can only select one option:
export enum ProjectStatus {
Ready = "Is ready",
Testing = "is testing",
Done = "is done"
}
<div *ngFor="let status of projectStatus; let i=index">
<mat-checkbox [checked]="selected.index === i"
(change)="selected.index = i; selected.status=status; selected.checked= true;">{{status}}
</mat-checkbox>
</div>
Then I got some others mat-checkbox:
<div>
<mat-checkbox>SEND REPORTS</mat-checkbox>
</div>
<div>
<mat-checkbox>WARN DEVELOPERS</mat-checkbox>
</div>
<div>
<mat-checkbox>WARN PROJECT MAANGER</mat-checkbox>
</div>
<div>
<mat-checkbox>WARN TESTERS</mat-checkbox>
</div>
My question is, how I can check another mat-checkbox dynamically based on the first checkbox list checked. I have to use ngModule?
For example, If I select:
is Testing
I want to check automatically the checkboxs:
SEND REPORTS
WARN DEVELOPERS
That's the link of the testing application:
https://stackblitz.com/edit/angular-vrnk7t-bxeplb?file=src%2Fapp%2Fcheckbox-overview-example.html
question from:
https://stackoverflow.com/questions/65920948/bind-angular-mat-checbox-ngmodule 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…