Reputation: 2719
I tried to display checkbox inside angular UI
<mat-checkbox [(ngModel)] = "item.role" [checked]="false">
<label>IT Admin</label>
</mat-checkbox>
I have attached image below and if I tried to create style for mat-checkbox the style is applied including label.
Upvotes: 0
Views: 5889
Reputation: 58
The style is applied to the label because the label is inside of the mat-checkbox tag. Try separating them and using a form group if you can.
<div class="form-group">
<label for="role">IT Admin</label>
<mat-checkbox id="role" [(ngModel)]="item.role" [checked]="item.role"></mat-checkbox>
</div>
This is under the assumption that you are using forms.
Upvotes: 1