This project was generated with Angular CLI version 1.6.3.
npm install angular-text-truncate --save
import AngularTextTruncateModule from 'angular-text-truncate';
By default just specify the text message that you want to truncate
<angular-text-truncate
[textMessage]="textMessage">
</angular-text-truncate>
all avilable attributes are:
-> [textMessage]="textMessage" // text message that needs to be truncated
-> [textDisplayLength]="200" // how many characters you want to display in trucated text, default will be 100,
-> [endingIcon]="endingTextIcon" // concat any icon at the end of truncated text, default will be '...' .
-> [displayLabels]="['show more', 'show less']" // send array of labels that needs to be displayed, default will be 'more' , 'less';
Example:
<angular-text-truncate
[textMessage]="textMessage"
[textDisplayLength]="200"
[endingIcon]="endingText"
[displayLabels]="['show more', 'show less']">
</angular-text-truncate>