在ngDraggable
project中,在ngDrag
指令中有一行代码
element.on(_pressEvents, onpress);
哪里
var _pressEvents = 'touchstart mousedown';
但是我遍历了整个代码,没有看到
$emit
,$broadcast
或_pressEvents
的任何touchstart
或mousedown
。这些事件是什么发布的?它是Angular中内置的吗?
最佳答案
这些是本机事件,由浏览器触发。
资料来源:
http://www.w3.org/TR/touch-events/
http://www.w3.org/TR/DOM-Level-2-Events/events.html#Events-eventgroupings-mouseevents