Hi guys,
I want to change ion-item background color when ion-item clicked/pressed.
like this picture below
i know ion-checkbox will solve my problem but i want this
here is my code
html:
<ion-list>
<button ion-item [ngStyle]="{'background-color': mybackcolor}" *ngFor="let type of people" (press)="utPeople(type)">
<ion-avatar item-start>
<img *ngIf="type.utilityImage==''" src="assets/imgs/img_avatar2.png">
<img *ngIf="type.utilityImage!=''" [src]="type.utilityImage">
</ion-avatar>
<h2>{{type.UtilityName}}</h2>
<p>{{type.UtilityMob}}</p>
<p>{{type.Rating}} <ion-icon name="star"></ion-icon></p>
</button>
</ion-list>
in ts:
utPeople(type){
console.log(type);
this.mybackcolor = '#c5c5c5;'
}