Angular JS触摸和滑动 [英] Angular JS Touch and Swipe
问题描述
我对angular JS非常陌生,并且正在开发移动应用程序.作为其中的一部分,我需要编写一个处理触摸事件的服务,例如向左滑动,向右滑动,向上滑动和向下滑动,并且需要根据执行的操作来回叫.请让我知道是否有任何有用的教程.
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.
推荐答案
如评论中所述,ngTouch是一个不错的起点,但是它只向左滑动和向右滑动.我建议使用角度手势;它是Hammer.js的一个有角度的实现,并且具有您需要的几乎所有内容:
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:
- 双击
- dragstart
- 拖动
- 拖动
- 拖动
- 拖动左
- dragright
- 拖动
- 按住
- 捏
- pinchin
- 缩小
- 发布
- 旋转
- 刷卡
- 轻扫
- 轻扫
- 向左挥动
- 直觉
- 点击
- 触摸
- transformstart
- 转换
- transformend
这篇关于Angular JS触摸和滑动的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!