RyanMullins / angular-hammer

Hammer.js v2 support for AngularJS
http://ryanmullins.github.io/angular-hammer/
MIT License
188 stars 55 forks source link

How to remove/unbind an event #51

Open TrangNguyen opened 9 years ago

TrangNguyen commented 9 years ago

Hi, I'm using angular-hammer to allow saving an object on vertical pan after passing a certain threshold. The logic is, if the dragging position event.center.y passes the threshold, it should trigger a save on panend. If it does not pass the threshold, the object returns to its starting position and by the next pan, it should reset. It works the first time, however, the event panend is registered — so if the first pan didn't reach the threshold (it still emit panend) which by the second pan (passing the threshold) the emitted panend would be called even though the current pan does not end.

Is there a way to remove/unbind the panend event?

Thank you