I've been struggling to find a solution for this issue. I have an ion-list with several ion-items generated from an array using *ngFor. My goal is to change the color of only the clicked item, but so far, all items are changing color on click.
Here's a snippet of the code:
<ion-col>
<ion-item *ngFor="let exercise of exercisesArray" (click)="onClick(exercise)" [ngStyle]="{color: color}">
{{exercise.title}}
</ion-item>
</ion-col>
</ion-list>
In my onClick function, I tried changing the color variable while passing the exercise as a parameter for other operations. However, this results in all items in the exerciseArray getting the same color. What I actually need is to isolate the color change to the specific item that was clicked.
Your assistance with this matter would be greatly appreciated!