I am trying to use this plugin in my demo https://github.com/STAR-ZERO/jquery-ellipsis . But I am not able to add ellipsis after two line .could you please tell me how to add ellipsis after two row
Here is my code:
$('.columnCss').ellipsis({
row: 2,
onlyFullWords: true
});
I am getting data in column of row .I want to add ellipsis when my column data is more than two lines
Hacky solution if you don't want to go through the trouble of creating a filter or a directive to do the same (I would only bother if it is going to be used many places):
app = angular.module('app', []);
app.controller('testController', function($scope){
$scope.arrayStrings = [
"this is the first line of data",
"this is the second line of data",
"this is the third line of data"
]
});
In your html:
<div ng-repeat="line in arrayStrings" ng-if="$index < 2">{{line}}</div>
<div ng-show="arrayStrings.length > 2">...</div>
You do not have to use DIV's. Pretty much any tag will do...