angularjs-truncate

An angular filter to truncate strings.
3 people use it
Author: Assets.github.com%2fimages%2fgravatars%2fgravatar-user-420 igreulich

Angular Truncate

This is my Truncate filter. It will truncate the text passed to it, defaulting to 10 characters.

Use

You need to include the igTruncate.js file before your app, but after angular.

Just put this filter on anything that returns a string;

For example…

// You can set the number of characters to truncate to {{string|truncate:15}}

Requirements

  • Angularjs (Tested against 1.0.1 through 1.0.7)

Todo

  • Write tests
comments powered by Disqus
This page was last updated over 4 years ago.