UNPKG

angoose

Version:

Angoose is a Remote Method Invocation module that comes with built-in mongoose/angular support. Now you can call server side module in browser just like you're in the server side!

11 lines (10 loc) 350 B
'use strict' angular.module('angoose.ui.filters').filter('shorten', function(){ return function(str){ if(typeof(str)!='string') return str; var re = /^.*\/([\/]+)$/ var m = re.exec(str); if(m) return m[1]; return str.length<50? str: "..."+str.substring(str.length-50, str.length); } });