apollodec/Apollo/bower_components/angular-truncate
saravanakumar_kandasami 7d72a0b91a updated code
2017-11-21 14:56:39 +05:30
..
demo updated code 2017-11-21 14:56:39 +05:30
scripts updated code 2017-11-21 14:56:39 +05:30
src updated code 2017-11-21 14:56:39 +05:30
test updated code 2017-11-21 14:56:39 +05:30
.bower.json updated code 2017-11-21 14:56:39 +05:30
.gitattributes updated code 2017-11-21 14:56:39 +05:30
.gitignore updated code 2017-11-21 14:56:39 +05:30
bower.json updated code 2017-11-21 14:56:39 +05:30
Gruntfile.js updated code 2017-11-21 14:56:39 +05:30
LICENSE updated code 2017-11-21 14:56:39 +05:30
package.json updated code 2017-11-21 14:56:39 +05:30
README.md updated code 2017-11-21 14:56:39 +05:30

Angular Truncate

This project is a filter for Angularjs to truncate text strings to a set number of characters or words and add ellipses when needed.

Demo

How to use angular truncate

###Include the javascript file.

<script src="truncate.js"></script>

###Inject the truncate filter into your app module.

var myApp = angular.module('myApp', ['truncate']);

###When outputting text, apply the filter.

 <p>
    {{ text | characters:25 }} or {{ text | words:5 }}
</p>

By default, a word will not be truncated. Set the optional boolean after the character count to true.

 <p>
     {{ text | characters:25 :true}}
 </p>