I'm a beginner in angular and I'm trying to fix a problem in which I can't toggle class on button clicks. It's a quiz app and In true/false question format there are 4 statements and 2 buttons to mark tick or cross against it but can use one active class (either true or false). Now, the logic I've used doesn't remove other class on the click of other button. Any help would be appreciated. Working stack blitz demo: https://stackblitz.com/edit/angular-ivy-4yczgp
component.html
<div class="statement-row"
*ngFor="let item of qblock.options;let j = index"
[ngClass]="{'wrong-answer': item.selectedIndex === j,'correct-answer':item.customIndex === j}">
<div class="statement-question">
<div class="qitem-text">
<div class="qitem-textbox">
<p>{{item.statement}}</p>
</div>
</div>
<div class="ccq">
<button class="qitem qclose"
(click)="item.selectedIndex=j">
<i class="qitembox qclose-icon"></i>
</button>
<button class="qitem qtick"
(click)="item.customIndex=j">
<i class="qitembox qtick-icon"></i>
</button>
</div>
</div>
</div>