0.0.3 • Published 6 years ago

ng-currency-formatter-onthefly v0.0.3

Weekly downloads
2
License
MIT
Repository
github
Last release
6 years ago

ng-currency-formatter-onthefly

Angular directive which formats the input as a currency while the user is typing. The model value is always numeric.

Installation

Bower

bower install --save ng-currency-formatter-onthefly

NPM

npm install --save ng-currency-formatter-onthefly

Usage

<div ng-controller="controller">
  <input ng-currency-formatter-onthefly ng-model="modelValue" type="text">
</div>

<script src="bower_components/angular/angular.js"></script>
<script src="bower_components/ng-currency-formatter-onthefly/ng-currency-formatter-onthefly.js"></script>
<script>
  angular
  .module('myModule', ['ng-currency-formatter-onthefly'])
  .controller('controller', function ($scope) {
    $scope.modelValue = '';
  });
</script>

With a module loader

Webpack

var currencyFormatter = require('ng-currency-formatter-onthefly/ng-currency-formatter-onthefly')
angular.module('myModule', [currencyFormatter])

Browserify

var currencyFormatter = require('ng-currency-formatter-onthefly')
angular.module('myModule', [currencyFormatter])