I'm writing a code where if a material is approved, it will appear with a blue mark next to it without me checking the checkbox. I tried the method below but, I can still check the box, it does not come already checked. This is what it should look like when the page is opened:
What am I doing wrong?
HTML:
<ng-container matColumnDef="IsApproved">
<th mat-header-cell *matHeaderCellDef> Ürün Onay Durumu </th>
<td mat-cell *matCellDef="let row; let i = index">
<mat-checkbox
[(ngModel)]="row.IsApproved" [ngModelOptions]="{standalone: true}"
binary="true"(onChange)="onChecked($event)"> Approved
</mat-checkbox>
</td>
</ng-container>
TS Code:
export class ManufacturerDetailComponent {
displayedColumns: string[] = [
"IsApproved",
];
IsApproved: boolean=false;
accept(){
this.onChecked(true)
}
onChecked(e: any){
this.IsApproved = true;
}
}
