Ionic 2 ion-item-sliding


#1

Hello,

I’m using the ion-item-sliding and I would want to know if I could reproduce the drag action with a single click on an icon to display my button in ion-items-options.

This is my code :

<ion-item-sliding *ngFor="let tab of pres; let i = index" #slidingItem>
      <ion-item>
           <ion-icon (click)="activeDeleteSwipe(slidingItem, i)" item-left name="md-remove-circle"></ion-icon>
           <ion-label>{{tab.name}}</ion-label>
      </ion-item>
      <ion-item-options side="right">
         <button ion-button class="deleteButton" (click)="deletePresentation(tab.id)" color="danger"> Delete</button> 
      </ion-item-options>
</ion-item-sliding>

With the #slidingItem I can do a slidingItem.moveSliding() in my ts but I don’t understand how to make it work properly.


#2

See this example.

Note: There is a minor issue in RC0 with the button not filling the expanded space. The fix has been made, but not released.