rwaltenberg / angular-money-mask

Angular directive to mask inputs with currency values
GNU General Public License v3.0
14 stars 14 forks source link

Angular Money Mask

An AngularJS (1.x) directive to mask inputs with currency values

Para ler este documento em Português, clique aqui

Usage

Download from npm or bower

$ npm install angular-money-mask --save

or

$ bower install angular-money-mask --save

Reference script file

<script src="https://github.com/rwaltenberg/angular-money-mask/raw/master/rw-money-mask.min.js"></script>

Inject rw.moneymask module

angular.module('yourApp', ['rw.moneymask'])

Bind directive money-mask

<input type="text" name="price" ng-model="model.price" money-mask />

Obs: ngModel is required!

How it works

Model

View

Options

Use money-mask-append and money-mask-prepend to add some text to the formatted currency.

<input type="text" name="price" ng-model="model.price" money-mask money-mask-prepend="$" />

or

<input type="text" name="price" ng-model="model.price" money-mask money-mask-append="dollars" />

Development - Contribute!