Error when using gestures in ionic 2


#1

so I tried using ionic gestures in ionic 2.
the swipe events are not fired

and the on-tap event produces a stack size limit error

list.html

<ion-title on-tap="hello()">My First List</ion-title>

list.js

hello(){
    console.log('hello')
  }

#2

Hmm, it seems to completely crash a tab when testing in chrome. Could you open an issue for this?


#3

There is an open issue:


#4

Possible workaround;

  let swiper = document.getElementById('swipe-to-connect');    
    let hammertime = new Hammer(swiper);
    hammertime.get('swipe').set({direction: Hammer.DIRECTION_UP})
    
    hammertime.on('swipe', (data)=> {
        console.log("MediathekPage.SWIPE",data);
    });

or check out:

ngAfterViewInit() {
    //Touch
    var presser = document.getElementById("longpress");

    this.pressGesture = new Gesture(presser);
    this.pressGesture.listen();
    this.pressGesture.on('press', e => {
    console.log('pressed!!');
    })
}

Ionic 2 Gestures?