|
3 yıl önce | |
---|---|---|
.. | ||
demo | 3 yıl önce | |
scripts | 3 yıl önce | |
src | 3 yıl önce | |
test | 3 yıl önce | |
.bower.json | 3 yıl önce | |
.gitattributes | 3 yıl önce | |
.gitignore | 3 yıl önce | |
Gruntfile.js | 3 yıl önce | |
LICENSE | 3 yıl önce | |
README.md | 3 yıl önce | |
bower.json | 3 yıl önce | |
package.json | 3 yıl önce |
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>