ng-input-currency

0.9.10 • Public • Published

ng-input-currency

Build Status Coverage Status npm

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!

Package Sidebar

Install

npm i ng-input-currency

Weekly Downloads

65

Version

0.9.10

License

none

Last publish

Collaborators

  • jstroem