Limit given string to max chars but keep full words
- AngularJS
Download from Github. File is located at the dist folder.
Load the script files in your application:
<script type="text/javascript" src="bower_components/angular/angular.js"></script>
<script type="text/javascript" src="path/to/file/improvedLimitFilter.js"></script>
Add the specific module to your dependencies:
angular.module('myApp', ['mk.improvedLimitFilter', ...])
Use it as filter and specify max chars and an optional suffix
<p> {{ stringToLimit | improvedLimit:20:'...'}} </p>