I’m using a “for” loop to create a list of click-able images for my app. When the user tap the image the “src” of the image change, using Ionics (tap) function. The problem I am having is that all the images change instead of just the image that was clicked.
soundboard.html
<ion-card-content>
<img [src]="imageUrl" (tap)="tapEvent($event)" />
</ion-card-content>
soundboard.ts
imageUrl = 'http://swiftylabs.com/Sounds-App/button-Unclicked.png';
tapEvent(e) {
this.imageUrl = 'http://swiftylabs.com/Sounds-App/button-Clicked.png';
setTimeout(() => this.imageUrl = 'http://swiftylabs.com/Sounds-App/button-Unclicked.png', 1000);
}