Angular Truncate 2 Demo

Example Text



Truncate using characters filter

Number of characters (will not break on a word):

Output

{{ text | characters:numChars : breakOnWord }}

Code

{{ text | characters:{{ numChars }}: {{ breakOnWord }}}

Truncate using words filter

Code

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

Output

{{ text | words:numWords }}

Truncate using splitcharacters filter

Code

{{ text | splitcharacters:{{ numWords }} }}

Output

{{ text | splitcharacters:numWords }}