/**
 * @ngdoc filter
 * @name slugify
 * @kind function
 *
 * @description
 * remove spaces from string, replace with "-" or given argument
 */

angular.module('a8m.slugify', [])

  .filter('slugify',[ function () {
    return function (input, sub) {

      var replace = sub || '-';

      if(isString(input)) {
        return input.toLowerCase()
          .replace(/\s+/g, replace);
      }

      return input;
    }
  }]);

@@ -269,18 +269,48 @@
 e = 
-sub %7C%7C '-'
+(typeof sub === 'undefined') ? '-' : sub
 ;%0A%0A 

Support for slugify filter taking empty string replacers (remove all whitespace).