Angular JS Touch and Swipe

user3311330 picture user3311330 · Jun 25, 2014 · Viewed 21.3k times · Source

I am very new to angular JS and working on a mobile application. As a part of it, I need to write a service that handles touch events like swipe-left, swipe-right, swipe-up and swipe down and I need to call back depending on which action is made. Please let me know if there any useful tutorials.

Answer

SgtPepper43 picture SgtPepper43 · Jun 25, 2014

As mentioned in the comments ngTouch is a good place to start, however it only has swipe left and swipe right. I recommend using Angular Gestures; it's an angular implementation of hammer.js, and has pretty much everything you'd ever need:

  • doubletap
  • dragstart
  • drag
  • dragup
  • dragdown
  • dragleft
  • dragright
  • dragend
  • hold
  • pinch
  • pinchin
  • pinchout
  • release
  • rotate
  • swipe
  • swipeup
  • swipedown
  • swipeleft
  • swiperight
  • tap
  • touch
  • transformstart
  • transform
  • transformend