directive changes

This commit is contained in:
gandhimathi 2018-04-12 15:37:36 +05:30
parent 17e4218ffa
commit a23c6b1b6f

View File

@ -37,4 +37,15 @@ app.directive('capitalize', function() {
capitalize(scope[attrs.ngModel]); // capitalize initial value
}
};
});
app.directive('disallowSpaces', function() {
return {
restrict: 'A',
link: function($scope, $element) {
$element.bind('input', function() {
$(this).val($(this).val().replace(/ /g, ''));
});
}
};
});