I want to create a angular js filter who will remove space with "-" and remove special character like ™ tm , ℠ sm, ® r,© .Below code will remove space with "-" but not remove the special characters
(function (angular) {
'use strict';
angular.module('myApp')
.filter('removespace', function () {
return function(input) {
if(input) {
return input.replace(/\s+/g, '-');
}
};
});
})(angular);
Output will be
LG Stylo™ 2 PLUS >> lg-stylo-2-plus
ZTE AVID® TRIO >> zte-avid-trio
ZTE ZMAX® Pro >> zte-zmax-pro
HTC Desire® 530 >> htc-desire-530
Galaxy S® 6 edge - Gold - 32GB - Cert. Pre-Owned >> galaxy-s-6-edge-gold-32gb-cert-pre-owned