RyanMullins / angular-hammer

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

Binding to release (end) event for hm-swipe-left / hm-swipe-right #76

Closed bartonsprings closed 6 years ago

bartonsprings commented 7 years ago

I have spend last few hours trying to figure out how to bind to an event that is fired on the release of the swipe (left or right).

  1. Is that capability built into angular-hammer?
  2. How to workaround if not built into library
  3. Is it possible to bind on a event that is fired on hmSwipe events in custom directive? Where to find list of events that I can listen on inside custom directive and use the standard touchend event to execute an angular expression?

I am using this:

<div hm-swipeleft="handleSwipe('left', 'item');" hm-swiperight="handleSwipe('right', 'item');" hm-recognizer-options='[ {"type":"swipe", "directions":"DIRECTION_HORIZONTAL"}, {"type":"pan","requireFailure":"swipe"} ]'> </div>

Apologize for multiple questions above but seems like I am stuck at this point.