Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

angular add ellipsis to template string

// How to truncate a string in Angular

<td *matCellDef="let animal">
	{{ (animal.name.length > 20) ? (animal.name | slice:0:20) + '...' : animal.name }}
</td>
Source by stackoverflow.com #
 
PREVIOUS NEXT
Tagged: #angular #add #ellipsis #template #string
ADD COMMENT
Topic
Name
3+5 =