Personalized and localized input masks for AngularJS
Installation
With Bower:
bower install --save angular-input-masks
How to use
-
Import the
masks.min.js
script in your page. -
Include the module
ui.utils.masks
in your angular app. -
Include the ui-mask directive in a text field like the examples abouve:
ui-number-mask
- Example:
- Define the number of decimals (default is 2):
- Allow negative numbers using the
ui-negative-number
attribute:
- Support to the
min
,max
andui-hide-group-sep
attributes.
<!-- Use 'ui-hide-group-sep' attribute if you don't want show the thousands separators-->
- Internationalized: Used the decimal separator and the thousands separator defined in the client browser configuration.
ui-percentage-mask
- Example:
- You can set the number of decimals (default is 2):
-
Support to the
min
,max
andui-hide-group-sep
attributes. -
Internationalized: Used the decimal separator and thousands separator defined in the client browser configuration.
ui-money-mask
- Example:
- Define the number of decimals (default is 2):
-
Support to the
min
,max
andui-hide-group-sep
attributes. -
Internationalized: Used the currency symbol, decimal separator and thousands separator defined in the client browser configuration.
ui-br-phone-number
ui-br-cep-mask
ui-br-cpf-mask
- Example:
ui-br-cnpj-mask
- Example:
ui-br-cpfcnpj-mask
- Example:
ui-br-ie-mask
-
Support masks for all the 27 brazillian states.
-
Validations according to the Sintegra especification.
More examples
See more usage examples in the Demo page
Filters
Looking for related filters? Take a look at angular-br-filters
Build
npm install
gulp build
Tests
gulp test:unit
- e2e:
- Uses Protractor + Jasmine
- Files: src/**/*.test.js
gulp test:e2e
- To run both tests:
gulp test