mudcube / Event.js

:hand: Multi-touch, gestures, and other events—click, dblclick, dbltap, tap, longpress, drag, swipe, pinch, rotate, shake. For pointer events, each listener can handle anywhere from 1 to 12 fingers at a time, or more, depending on the device. Includes MetaKey tracking (CMD, CTRL) to support native key-commands in various platforms.
MIT License
368 stars 68 forks source link

Angularjs + Event.js = ng-click problem #10

Closed marcog83 closed 9 years ago

marcog83 commented 10 years ago

Hi, I use event.js in conjuntion with fabric.js to manipulate canvas on mobile phone. As application framework I use angularjs 1.2.7.

I added ng-click directive on anchor element, and that anchor is dinamically added and removed from DOM.

html: [blockcode] < a ng-click="doSomething()" href="javascript:void(0)">DO STUFF [blockcode]

problem: "doSomething" listener is not executed and each time I remove anchor element this error occurs

Listener is not a function! [a, "click", Array[1], Object, "remove", true]

I know it's a very generic description, but I can't isolate a piece of code.

image

I attached a screenshot from devtools, I hope it can help

P.S. I commented this line

eventManager(this, type, listener, configure, trigger, true);

and uncommented the follow one

handler.call(this, type, listener, useCapture);

Error disapears and listeners are ok now. But actually I don't know what happened :P

eshwarg commented 10 years ago

I am having the same problem, But am using Backbone instead of Angular JS. Can you help me by providing a solution for this.

miracle2k commented 10 years ago

Presumably you need to disable the variables mentioned in the README under "Turn prototyping on/off". It also breaks Qooxdoo and jQuery.

mudcube commented 9 years ago

Yup, exactly as miacle2k mentioned, turn those two features off and you'll be good to go. I contacted Fabric to let them know they can update to the latest package of Eventjs