Creating one:
.filter('truncate', function(){
return function(input, limit){
return (input.length > limit) ? input.substr(0, limit)+'…' : input;
};
})The first argument in the returning function is the input data we are filtering on, we can add any number of arguments after that.
See it in action here