I have an angular 5 material checkbox with a surrounding div and some other elements. I want a click on the div to be the same as a click directly on the checkbox.
Here is my example code:
<div (click)="checked = !checked">
<mat-checkbox class="example-margin" [(ngModel)]="checked">
I'm a not working checkbox :'(
</mat-checkbox>
<span style="background-color: #dddd00;">I want to be clickable too</span>
</div>
and a Stackblitz
At the moment clicking on the checkbox itself is not working, clicking outside the div works. Any ideas?
()around ngModel...