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

angular.module('remove-spaces', [])

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

      var replace = sub || '-';

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

      return input;
    }
  }]);

'use strict';

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

angular.module('remove-spaces', [])

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

      var replace = sub || '-';

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

      return input;
    }
  }]);

add use strict