To effectively handle touch events, make sure to start by listening for the start event, triggered either by a mousedown or touchstart action. Following this initial event, $swipe will only recognize touchmove or mousemove events if the user exceeds a predefined threshold in either direction.
Once this threshold is surpassed, the move event will be generated.
If you are using AngularJS alone, adding a listener for the move event may not be possible. In such cases, incorporating JQuery can offer a viable solution. Consider implementing something similar to the following code snippet:
$('#someElm').bind('touchmove',function(e){
e.preventDefault();
var touch = e.originalEvent.touches[0] || e.originalEvent.changedTouches[0];
var elm = $(this).offset();
var x = touch.pageX - elm.left;
var y = touch.pageY - elm.top;
if(x < $(this).width() && x > 0){
if(y < $(this).height() && y > 0){
//YOUR CODE HERE
console.log(touch.pageY+' '+touch.pageX);
}
}
});
For further information on handling touch events with Angular, refer to the official Angular documentation: AngularJS API : $swipe