I have been using ionic 2 for a few weeks now and love it. However, I’m not sure of the best practice to perform the following.
I have an custom ion-card that contains a button which fills the entire element so that it is clickable (as below)
<ion-card class="schedule-card" *ngFor="#session of group.sessions"> <ion-card-content class="content"> <ion-item-sliding> <button ion-item (click)="goToSessionDetail(session)"> <div class="container"> // Removed to simplify example </div> </button> </ion-item-sliding> </ion-card-content> </ion-card>
What I am trying to achieve is that when the button is pressed, the background-colour of the parent ion-card class ‘schedule-card’ changes. I am very lost how to do this however. Any help would be greatly appreciated.