I\'m new to angularJS and maybe have written something bad...
but how could i right implement this plugin: https://github.com/BeSite/jQuery.dotdotdot
on my t
As @pankajparkar noted in comments, this really shouldn't be maintained in a $watch
. Doing so executes the element.dotdotdot()
configuration call several times in any given session--for example every time a key is pressed or the mouse is clicked. Part of the slowdown could be the plugin itself and how it manages the watching it does, but aside from that you should see improvement by simply removing the $watch:
.directive('dotdotdot', function(){
return {
restrict: 'A',
link: function(scope, element, attributes) {
element.dotdotdot({watch: true, wrap: 'letter'});
}
}
});