I am using angular 1.4.0 and jQuery v1.11.1.
I am trying to use ngTouch/ngSwipe. Both will not stop throwing the error "TypeError: element.on is not a function" on app loading (inside the bind-function). Sadly I can't reproduce this error in a plunkr, anyhow ngSwipe runs into that issue, when:
bind: function(element, eventHandlers, pointerTypes) {
...
pointerTypes = pointerTypes || ['mouse', 'touch'];
element.on(getEvents(pointerTypes, 'start'), function(event) {... <-- error here
I don't think this is too much an issue with my other code, but that I'm missing some kind of dependency. Anyone got an idea?
Thanks in advance.
The
$onmethod is part of theangular.elementobject, whereas theonmethod is part of the jQuery object. Theelementin question is a DOM object, which has no such method. The closest equivalent would be:or:
References