|
hace 1 año | |
---|---|---|
.. | ||
demo | hace 1 año | |
scripts | hace 1 año | |
src | hace 1 año | |
test | hace 1 año | |
.bower.json | hace 1 año | |
.gitattributes | hace 1 año | |
.gitignore | hace 1 año | |
Gruntfile.js | hace 1 año | |
LICENSE | hace 1 año | |
README.md | hace 1 año | |
bower.json | hace 1 año | |
package.json | hace 1 año |
This project is a filter for Angularjs to truncate text strings to a set number of characters or words and add ellipses when needed.
###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>