I am currently working with a directive that includes event listeners for an element in the link function.
For example:
...
link: function(scope, element) {
// this gives us the native JS object
var el = element[0];
el.draggable = true;
el.addEventListener('dragstart', ...);
}
...
Now, I am using this directive within an ng-repeat
.
I am curious to know if a new event listener will be created for each element within the ng-repeat?
If there are 100 items in the ng-repeat, could this potentially impact performance?
If so, are there any modifications I could make to have all elements connected to the same event listener?