Created
December 3, 2014 21:06
-
-
Save andresmatasuarez/5d4adad758f09d9873f7 to your computer and use it in GitHub Desktop.
AngularJS | Filter | Replace exceeding characters in a string with '...'
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
'use strict' | |
app = angular.module 'app' | |
app.filter 'threeDots', ($filter) -> | |
(value, maxLength) -> | |
if value.length > maxLength | |
$filter('limitTo')(value, maxLength).trim() + '...' | |
else | |
value |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment