Distinguish swipe and click in Angular

I use ng-click to show details of an item in a list and also I attach jQuery mobile swipe event to the list item to show delete button when a user swipes to the left. The problem is that when I swipe on the element, it doesn't only emit swipe event, but click event as well. So, when I want to swipe to delete an element, it shows the delete button and opens details view.

What can I do about this? It would be cool to have something like ng-swipe.


The most recent unstable angularjs (1.1.4+) builds include both an ngSwipeLeft and ngSwipeRight directive. You must take care to reference the angular-mobile.js library.

https://github.com/angular/angular.js/blob/master/src/ngMobile/directive/ngSwipe.js

链接地址: http://www.djcxy.com/p/13712.html

上一篇: 如何知道Scroll里面的View是完全可见还是不可见

下一篇: 区分滑动并点击Angular