我正在使用 dotdotdot 似乎是一个很酷的插件......但是,我需要使用它的角度,如果加载了新元素(通过 http.get <> ng-repeat)则不起作用......
所以我发现有一个angular-dotdot ...如何使用它?不是很清楚...
假设我有 dotdotdot 的经典用法,如下所示:
// ellipsis body to 4 lines height
var ellipsis = $(".ellipsis-case-body");
var nrLines = 4;
var ellHeight = parseInt(ellipsis.css('line-height'), 10) * nrLines;
ellipsis.dotdotdot({ height: ellHeight });
// ellipsis title to 1 line height
ellipsis = $(".ellipsis-case-title");
nrLines = 1;
ellHeight = parseInt(ellipsis.css('line-height'), 10) * nrLines;
ellipsis.dotdotdot({ height: ellHeight });
如何与角度一起使用它?
在他们的文档中
$scope.myText = 'some really long text';
模板:
<p dotdotdot='myText'>{{myText}}</p>
但是如何设置选项?