javascript - Angular Directive addEventListener with ng-repeat -


i have directive adds few event listeners element in link function.

e.g.:

... link: function(scope, element) {     // gives native js object     var el = element[0];      el.draggable = true;      el.addeventlistener('dragstart', ...); } ... 

now use directive inside of ng-repeat. question is, make new eventlistener each element inside of ng-repeat ?

if so, have 100 items within ng-repeat, cause performance problems ?

if so, changes make attach elements same event listener ?

yes, add event each element in ng-repeat. directives executed 1 time per element have attached.the listener not cause major performance issues. (no more ng-repeat, not performant)


Comments

Popular posts from this blog

php - Invalid Cofiguration - yii\base\InvalidConfigException - Yii2 -

How to show in django cms breadcrumbs full path? -

ruby on rails - npm error: tunneling socket could not be established, cause=connect ETIMEDOUT -