Sha256: 7302907246e5dc88e5f45aa179d02f4d3d77281a19df645b6215be02fc427a00
Contents?: true
Size: 766 Bytes
Versions: 15
Compression:
Stored size: 766 Bytes
Contents
'use strict'; /* Filters */ var filters = angular.module('mongoRequestLogger.filters', []); /** * Truncate Filter * Adapted from https://gist.github.com/2478654 * * @Param string * @Param int, default = 10 * @Param string, default = "..." * @return string */ filters.filter('truncate', function () { return function (text, length, end) { text = String(text); if (isNaN(length)) length = 10; if (end === undefined) end = "..."; if (text.length <= length || text.length - end.length <= length) { return text; } else { return String(text).substring(0, length-end.length) + end; } }; });
Version data entries
15 entries across 15 versions & 1 rubygems