I'm working on adding a show/hide feature to the play and pause buttons for a list of tracks in Angular 7. I had some success with Angular animation initially, but encountered an issue where all buttons in my list would change state instead of just one. I also attempted to use ngClass without achieving the desired result.
Here is my latest attempt. Any assistance would be greatly appreciated.
<mat-card class="track-box" *ngFor="let track of tracks" cdkDrag>
<div class="custom-placeholder" *cdkDragPlaceholder></div>
<span>
<mat-icon
class="play-button md-48"
[ngClass]="{'show' : track === selectedTrack}"
(click)="toggle(track)"
> play_circle_outline</mat-icon>
<mat-icon
class="pause-button md-48"
[class.selected2]="track === selectedTrack"
(click)="toggle(track)"
>pause_circle_outline</mat-icon>
</span>