When I click on an item, I want to add a class name. If I click on the same item again, I want to remove the class for ngFor loop.
<ion-item *ngFor="let x of statementresponse; let i=index" class="cust_delay delay" [ngClass]="{'active': selectedItem == x}" (click)="listClick($event, x)" >
</ion-item>
selectedItem: any;
listClick(event, newValue) {
console.log(newValue);
this.selectedItem = !newValue;
}