Masked input https://github.com/digitalBush/jquery.maskedinput

The plugin allows a user to more easily enter fixed width input where you would like them to enter the data in a certain format (dates,phone numbers, etc).




Usage


require(['jquery', 'px-libs/jquery.maskedinput'], function($) {
  ...
});
        

Usage

To use maskedinput plugin, you need to include the next scripts:


<script src="path/to/js/libs/jquery.maskedinput.js"></script>
<script src="path/to/js/pixeladmin/directives/angular-maskedinput.js"></script>
        

Then inject the plugin into your angular application:

angular.module('yourApp', ['angular-maskedinput']);

Alternatively, you can include maskedinput plugin using ocLazyLoad plugin:


$ocLazyLoad.load([
  {
    name: 'angular-maskedinput',
    files: [
      'path/to/js/libs/jquery.maskedinput.js',
      'path/to/js/pixeladmin/directives/angular-maskedinput.js'
    ],
  },
]);
        

maskedinput directive

You can use maskedinput directive on input elements. And when the scope is destroyed the directive will be destroyed.

Options

maskedinput's options can be specified as attributes (see the plugin's documentation). All options expect an angular expression instead of a literal string.

  • autoclear
  • completed
  • mi-placeholder

<input maskedinput type="text" class="form-control"
       mask="'a*-999-a999'"
       mi-placeholder="'_'">