Giter Club home page Giter Club logo

angular-input-masks's Introduction

angular-input-masks Build Status Coverage Status Standard Version

NPM

Join the chat at https://gitter.im/assisrafael/angular-input-masks Bountysource

Opinionated angular input masks. Provides ready to use masks with little (br/inscricao-estadual) to no configuration (number, cnpj, etc).

Compatibility

  • angular-input-masks@~2: angular@^1.3 (however is only tested with lastest 1.x version) and ECMAScript 5 compliant browsers (however CI only tests chrome and firefox).
  • angular-input-masks@~1: angular@~1.2

Installation

npm install --save angular-input-masks

Configuration

Without browserify:

  1. Import the angular-input-masks-standalone.min.js script in your page. For example:
<script src="angular-input-masks-standalone.min.js"></script>

Obs: for npm the build scripts are available inside releases folder.

  1. Include the module name ui.utils.masks in your angular app. For example:
angular.module('app', ['ui.utils.masks']);

With browserify:

angular.module('demo', [require('angular-input-masks')]);

Internationalization

Some masks are internationalized, so you need to include the proper angular-locale in your app(see: https://docs.angularjs.org/guide/i18n).

How to use

  • Number mask Example :
<input type="text" name="field" ng-model="number" ui-number-mask>
  • Define the number of decimals (default is 2):
<input type="text" name="field" ng-model="number" ui-number-mask="3">

More examples

See more usage examples in the Demo page

Other build options

If you are using npm (without browserify):

  • angular-input-masks-dependencies.js: provides all external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks-br.js: provides only global and BR directives, and does not include external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks-us.js: provides only global and US directives, and does not include external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks-fr.js: provides only global and FR directives, and does not include external dependencies (string-mask, br-validations, momentjs)
  • angular-input-masks.js: provides all directives, and does not include external dependencies (string-mask, br-validations, momentjs)

If you are using npm with browserify:

  • require('angular-input-masks'): provides all directives
  • require('angular-input-masks/br'): only global and BR directives
  • require('angular-input-masks/us'): only global and US directives
  • require('angular-input-masks/fr'): only global and FR directives

Filters

Looking for related filters? Take a look at angular-br-filters

Build

npm install
npm run build

Tests

npm run test:unit
  • e2e:
  • Uses Protractor + Jasmine
  • Files: src/**/*.spec.js
npm run test:e2e
  • To run both tests:
npm test

angular-input-masks's People

Contributors

aktary avatar assisrafael avatar b2ys avatar detinho avatar dvbeato avatar ericrguimaraes avatar fabiobarbosa1984 avatar gaven avatar gitter-badger avatar gmq avatar guilherme22 avatar houmark avatar leonnleite avatar marcelinhov2 avatar marcomafessolli avatar mbenedettini avatar neokyox avatar neves avatar neysimoes avatar nloding avatar nucleartux avatar olavocneto avatar pavelpykhtin avatar pavlokitdev avatar philippspinnler avatar richardaum avatar scardine avatar svemir avatar the-darc avatar wfgomes avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.