You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
trustieforge/public/javascripts/wechat/directives/ellipsis.js

18 lines
517 B

/**
* Created by Tim on 7/22/16.
*/
app.directive('ellipsisShow',["$timeout",function(timer){
return{
restrict: 'A',
scope: {},
link: function(scope, element){
timer(function() {
var textContent = element.text();
console.log(textContent);
//while (textHeight > 100) {
// element.text(element.text().replace(/(\s)*([a-zA-Z0-9]+|\W)(\.\.\.)?$/, "..."));
//}
});
}
}
}]);