I am trying to use an Angular Material checkbox, and set it by default as checked, but it is displayed as non-checked, what is wrong?
<mat-checkbox class = "example-margin" [(ngModel)] = obj.impresora>
<label>Printer</label>
</mat-checkbox>
obj.impresora property is boolean
You can either set with ngModel either with [checked] attribute. ngModel binded property should be set to 'true':
1.
<mat-checkbox class = "example-margin" [(ngModel)] = "myModel">
<label>Printer </label>
</mat-checkbox>
2.
<mat-checkbox [checked]= "myModel" class = "example-margin" >
<label>Printer </label>
</mat-checkbox>
3.
<mat-checkbox [ngModel]="myModel" class="example-margin">
<label>Printer </label>
</mat-checkbox>