Angularjs Doesn't Trigger Event Handled By Addeventlistener
I'm trying to trigger event on a element with mousedown event handled by addEventListener call but I don't know why it doesn't work. I tried to use angular.element(el).tr
Solution 1:
Angular uses jqLite internally. If you load jQuery before Angular it will use jQuery instead of jqLite.
triggerHandler
only triggers events that are added by jqLite/jQuery.
To trigger events added by addEventListener
you need to use the standard API.
For example:
var el = document.getElementById('zero');
el.click();
Or:
var el = document.getElementById('zero');
el.dispatchEvent(newEvent('click'));
If you need to support older browsers you can start by reading here.
Post a Comment for "Angularjs Doesn't Trigger Event Handled By Addeventlistener"