Last active
September 21, 2017 10:19
-
-
Save falexandre/915f7afe0591659f1247f7cf554a93ae to your computer and use it in GitHub Desktop.
angular strLimit
This file contains hidden or 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
phoneCat.filter('strLimit', ['$filter', function($filter) { | |
return function(input, limit) { | |
if (! input) return; | |
if (input.length <= limit) { | |
return input; | |
} | |
return $filter('limitTo')(input, limit) + '...'; | |
}; | |
}]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment