<p ng-repeat="name in names">{{name | cancatSpace}} </p>
app.filter('cancatSpace', function () {
return function (input) {
return input.replace(/\s+/g, '');
};
});
With above code, if my name is 'hello world' it should become helloworld, but it didn't. I don't see any error. Anything else I missed out? I tried to do console.log(input) in my filter it doesn't console anything?