Angular Truncate - Ellipsis for your templates

Downloads in past


313181.0.06 years ago6 years agoMinified + gzip package size for angular-ng-truncate in KB


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.

``` html ```

Inject the truncate filter into your app module.

```javascript var myApp = angular.module('myApp', 'truncate'); ```

When outputting text, apply the filter.


{{ text | characters:25 }} or {{ text | words:5 }}

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

{{ text | characters:25 :true}}