Skip to content

Instantly share code, notes, and snippets.

@falexandre
Last active September 21, 2017 10:19
Show Gist options
  • Save falexandre/915f7afe0591659f1247f7cf554a93ae to your computer and use it in GitHub Desktop.
Save falexandre/915f7afe0591659f1247f7cf554a93ae to your computer and use it in GitHub Desktop.
angular strLimit
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