Simple input mask for AngularJS. Demo
With Bower:
bower install --save ng-blackmask
-
Include the module
blackMaskin your angular app. -
Include the directive
bm-numbers-maskwithmax-lengthparam in your form:
<input type="text" name="field" ng-model="field" bm-numbers-mask max-length="9">- You can set the placeholder character (the default is
_):
<input type="text" name="field" ng-model="field" bm-numbers-mask max-length="9" placeholder="*">IE8+, Chrome, Firefox, iOS 7 Safari/Chrome. Unfortunately Android browsers don't work with this mask correctly so be careful if you want to support them