'use strict'; angular .module('hiringappApp') .filter('stringReplace',function () { return function (input, from, to) { input = input || ''; from = from || ''; to = to || ''; return input.replace(new RegExp(from, 'g'), to); }; }); (function() { 'use strict'; angular .module('hiringappApp') .filter('stringReplace', stringReplace); function stringReplace() { return function (input, from, to) { input = input || ''; from = from || ''; to = to || ''; return input.replace(new RegExp(from, 'g'), to); }; } })();