ng-input-currency
v0.9.10
Published
input formatter as currency with Angular
Downloads
125
Readme
ng-input-currency
Angular directive for formatting inputs as currency fields. This repo is inspired by format-as-currency.
Demo
http://jstroem.github.io/ng-input-currency/demo
Installation
Install via bower or NPM:
- Bower:
bower install --save ng-input-currency
- NPM:
npm install --save ng-input-currency
Usage
<div ng-controller="myController">
<input ng-input-currency ng-model="value" type="text">
</div>
<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/format-as-currency/format-as-currency.js"></script>
<script>
angular
.module('myModule', ['ngInputCurrency'])
.controller('myController', function ($scope) {
$scope.value = '' // currency input value
});
</script>
With a module loader
Browserify
var formatAsCurrency = require('ng-input-currency')
angular.module('myModule', [ngInputCurrency])
Rollup
import * as ngInputCurrency from 'ng-input-currency'
angular.module('myModule', [ngInputCurrency])
Webpack
var ngInputCurrency = require('ng-input-currency')
angular.module('myModule', [ngInputCurrency])
Running the tests
npm test
Contributing
Contributions are welcome!