Ion-content swipeEvent


#1

Hi,
I can’t intercept the swipe event in a ion-content div:

<ion-content padding-bottom class=“home” (swipe)=“swipeEvent($event)”

Why? What is the correct way?


#2

Hi, see if this is any help.


#3

Thx, but I think that my problem is related to this issue:


#4

I think it is because you are using it in the ion-content
This worked for me…in the html.

  <ion-card (swipe)="swipeEvent($event)">
    <ion-item>
      Swiped: {{swipe}} times
    </ion-item>
  </ion-card>

in .ts

public swipe: number = 0;

  swipeEvent(e) {
    this.swipe++
  }

Swipeable overly
#5

Yes, with ion-card I have not problems. The problem is the ion-content.


#6

Yes, I do not think (swipe)="swipeEvent($event) works in the ion-content. You will have to use another directive.
But an alternative is to create a div inside the ion-content and insert your content inside the div.

<ion-content>
  <div (swipe)="swipeEvent($event)">
    Content...
  </div>
</ion-content>

.ts

   swipeEvent(e) {
    console.log('swiped');
  }