Add ngMask plugin after your AngularJS.
<script src="angular.min.js"></script>
<script src='ngMask.min.js'></script>
Add ngMask module dependency to your app.
angular.module('yourApp', ['ngMask']);
Use the avaiable patterns to create your mask. Set the mask as input attribute.
<input type='text' ng-model='maskModel' mask='39/19/9999' />
"/" isn't a pattern. It's considered a divisor. Every divisor is automatically written by ngMask. Check all available patterns here.
Adjust your mask options.
<input type='text' ng-model='maskModel ng-value='0/3/9' mask='3/9?' mask-repeat='2' mask-restrict='accept' mask-clean='true' mask-validate='false' mask-limit='false' />
Generated mask '3/9?3/9?'. Check all available options here.
You can make your mask using some patterns available. If you use a pattern not specified below to construct your mask, It'll be considered a divisor. A dividor is a character used to group semantic elements, for example: "/" in dates to separate days, months and years, "-" in SSN to separate area, group and serial numbers or "." in IPv4 to create 4 groups of 8 bits.
NgModel (required): model object
Attribute 'ng-model'The model of input.
Mask (required): mask definition
Attribute 'mask'The mask for input.
NgValue: initial mask value (default: undefined)
Attribute 'ng-value'The initial value of input.
Restrict: 'select', 'reject' or 'accept' (default: select)
Attribute 'mask-restrict' or 'restrict'The way how ngMask will interact with user input. Select restriction: The input will show the char inputted even on error cases. If it has errors, the wrong char will be selected. Reject restriction: The input will show the char inputted on successfull cases. If it has errors, the wrong char will be rejected. Accept restriction: The input will always show the char inputted. No matter it's right or wrong.
Repeat: number - repeat mask n times (default: undefined)
Attribute 'mask-repeat' or 'repeat'Repeats the mask attribute the defined times.
Clean: 'true' or 'false' (default: false)
Attribute 'mask-clean' or 'clean'Cleans model value. Removes divisors from model value.
Validate: 'true' or 'false' (default: true)
Attribute 'mask-validate' or 'validate'Applies validation. Uses form controller setValidity method.
Limit: 'true' or 'false' (default: true)
Attribute 'mask-limit' or 'limit'Limits the max length inputted according with mask.