How to change background color of ion-item inside ion-list onhold event in ionic2


#1

suppose i have ion-list


<ion-list>
    <span *ngFor="let user of users | async">
      <a ion-item (click)="openItem(user)" (onhold)="selectUser(user.$key)" *ngIf="user.$key !== uid" color= colorVar>
        <ion-avatar item-left>
          <img *ngIf="!user.picture" src="assets/img/profile.png">
          <img *ngIf="user.picture" src="{{user.image}}">
        </ion-avatar>
        <ion-label>{{user.username}}</ion-label> 
    </a>
    </span>
 </ion-list>

when i try to change color using the colorVar variable it changes the color of all items inside the list while i want to change color only that specific item.
Please help me out
My main objective to select ion-list item onhold gesturePreformatted text


#2

Please edit your post and use the </> button above the post input field to format your code or error message or wrap it in ``` (“code fences”) manually. This will make sure your text is readable and if it recognizes the programming language it also automatically adds code syntax highlighting. Thanks.