I'm styling a checkbox as a button by placing it inside it's label
<label>
<input type="checkbox" name="...">
</label>
I need to toggle the parent label's class based on whether the checkbox is checked. Now, this would be easy using [ngClass] and a boolean. The problem is, I'm also looping the elements with an *ngFor directive. This apparently used to work in Angular 1.x.x, but in Angular 2/4/... it adds/removes the class for all elements that are repeated. This could easily be solved by accessing the parent DOM elements classList directly, but this is considered a bad practise in Angular. Is there any Angular way to do this or do I have to change my approach completely?
EDIT: my code EDIT 2: Wrong code, fixed.
<label *ngFor="let item of object.array" [ngClass]="{'label-active': checked}">
{{item}}
<input (click)= "checked = !checked" type="checkbox" name="..." id="..." class="sr-only">
</label>