I tried to write test case for directive, But i can't write. So, guys can u share the correct test case with explanation for given directive.js.
myapp.directive('number', function() {
return {
restrict: 'A',
link: function(scope, element, attr, form) {
element.bind('input', function(e) {
$(this).val($(this).val().replace(/[^0-9 ]/gi, ''));
});
}
}
});
This directive should return numbers only.