require(['jquery', 'px-libs/jquery.maskedinput'], function($) {
...
});
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.
maskedinput's options can be specified as attributes (see the plugin's documentation). All options expect an angular expression instead of a literal string.
<input maskedinput type="text" class="form-control"
mask="'a*-999-a999'"
mi-placeholder="'_'">