apollo_developers/bower_components/angular-truncate/README.md
saravanakumar_kandasami a11795c215 SIT code
2018-04-19 18:17:06 +05:30

35 lines
741 B
Markdown

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](http://sparkalow.github.io/angular-truncate/)
## How to use angular truncate
###Include the javascript file.
``` html
<script src="truncate.js"></script>
```
###Inject the `truncate` filter into your app module.
```javascript
var myApp = angular.module('myApp', ['truncate']);
```
###When outputting text, apply the filter.
```html
<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.
```html
<p>
{{ text | characters:25 :true}}
</p>
```