Angular Truncate Demo

Example Text



Truncate by characters

Output

{{ text | characters:numChars : breakOnWord }}

Code

{{ text | characters:{{ numChars }}: {{ breakOnWord }}}
Truncate by words

Code

{{ text | words:{{ numWords }}:ignoreSpaces }}

Output

{{ text | words:numWords }}




Downloadtruncate.js