angularJS: dotdotdot for overflow text and performance

后端 未结 4 937
暖寄归人
暖寄归人 2021-01-07 01:31

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

4条回答
  •  青春惊慌失措
    2021-01-07 01:51

    I had this same problem and ended up just applying a class "dotdotdot" to all elements that I wanted the jquery.dotdotdot thing to run on, and then manually calling $('.dotdotdot').dotdotdot() whenever those element updated. You have to be careful to not use a $watch or anything like that or you'll just have the same issue as if you used the directive. Not a pretty fix, but it is efficient.

    Had to do this, because removing the $watch in the directive has weird side effects if you are using rawHtml binding or custom filters on the element in question.

提交回复
热议问题