I am trying to implement AngularJs directive to remove any special character from input and textarea but its not working and i do not see any error in console. I also have toolt
Try this:
angular.module("test", []).filter("purger", function() {
return function(input) {
return input.replace(/[^\w\s]/gi, "");
}
}).controller("testController", function($scope, purgerFilter) {
$scope.value = purgerFilter("^..test/$");
$scope.onChange = function() {
$scope.value = purgerFilter($scope.value);
}
})