nglar / ngTouchmove

A angular module to add directive `ng-touchmove`.
MIT License
3 stars 3 forks source link

[1.0] Detect direction #8

Closed jamesbondo closed 8 years ago

jamesbondo commented 8 years ago

thanks! can it decide moving left or right from the directive ?

marktopper commented 8 years ago

This should be possible once I have fixed #2. Once that is done I will get back to you with a solution for this.

marktopper commented 8 years ago

If I am right, you wanna know whether or not it moves a certain direction.

Something like:

$scope.onTouchmove = function() {
  if (movingRight) {
    // do something
  } else if (movingLeft) {
    // do something
  }
};

Am I right @jamesbondo?

marktopper commented 8 years ago

In case I am right then I would use ngTouchstart and ngTouchmove (or together with ngTouch) library.

Then save the coordinations for the touchstart event, and then on touchmove I would check the coordinates against the new event.

marktopper commented 8 years ago

Closing it for now - however let me know if this does not resolve your issue.