Registry / productivity / ng-input-currency

ng-input-currency

JSON →
library0.9.10jsnpmunverified

Angular directive for formatting input fields as currency values. Current version 0.9.10. The package is stable but has not seen updates since 2016. It depends on AngularJS (1.x) and format-as-currency. Key differentiators: simple directive approach for currency input masking in AngularJS applications. Alternative modern solutions exist for Angular 2+.

npm install ng-input-currency
INSTALL
IMPORT
SIG · NG-INPUT-CURRENCY
N
ng-input-currency
productivityjavascriptv0.9.10
harness data pending
Install & Compatibility
Where this runs

No compatibility data collected yet for this library.

Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

ngInputCurrency
angular.module('myModule', ['ngInputCurrency'])
const ngInputCurrency = require('ng-input-currency')
The module name is 'ngInputCurrency' as a string, not the variable. In module loaders like Browserify/Webpack, you assign the required value to a variable but still use the string name.
directive
<input ng-input-currency ng-model='value' type='text'>
<input currency-format ng-model='value'>
The directive is used as attribute 'ng-input-currency'. Ensure input type is 'text' (not number).
module name
var ngInputCurrency = require('ng-input-currency'); angular.module('app', [ngInputCurrency])
angular.module('app', ['ng-input-currency'])
When using a module loader, the dependency is the exported value (the module name string), not the package name.

Shows complete setup: install dependencies, include scripts, declare AngularJS module with ngInputCurrency, and use the directive on an input.

// Install: npm install --save ng-input-currency // Then in your HTML: // <div ng-controller="myController"> // <input ng-input-currency ng-model="value" type="text"> // </div> // <script src="node_modules/angular/angular.js"></script> // <script src="node_modules/format-as-currency/format-as-currency.js"></script> // <script src="node_modules/ng-input-currency/ng-input-currency.js"></script> // <script> // angular.module('myModule', ['ngInputCurrency']) // .controller('myController', function($scope) { // $scope.value = ''; // }); // </script>
Debug
Known issues
deprecatedPackage supports only AngularJS (1.x), not Angular 2+.
fix
Use a modern alternative like ngx-currency for Angular 2+.
affects: >=0
breakingRequires format-as-currency as a separate dependency. Not including it causes 'formatAsCurrency is not defined' error.
fix
Install and include format-as-currency script before ng-input-currency.
affects: <1.0
gotchaUsing input type='number' with this directive may cause unexpected behavior or prevent formatting.
fix
Always use type='text' on the input element.
affects: >=0
deprecatedPackage has not been updated since 2016; no support for newer AngularJS versions or modern module systems.
fix
Consider migrating to a maintained alternative.
affects: >=0
Errors
Common errors & fixes
formatAsCurrency is not defined
Missing format-as-currency dependency script.
fix
Include <script src='node_modules/format-as-currency/format-as-currency.js'></script> before ng-input-currency.
[$injector:modulerr] Failed to instantiate module myModule due to: Error: [$injector:modulerr] Failed to instantiate module ngInputCurrency due to: Error: [$injector:nomod] Module 'ngInputCurrency' is not available!
Missing script inclusion of ng-input-currency.js or incorrect module name.
fix
Ensure ng-input-currency.js is loaded and module name is exactly 'ngInputCurrency'.
Can't find variable: formatAsCurrency
format-as-currency script not loaded in browser.
fix
Add the script tag for format-as-currency before ng-input-currency.
Upgrade
Version history
0.9.10latest on npm
Audit
Dependencies
angularrequiredpeer dependency: AngularJS 1.x
format-as-currencyrequiredruntime dependency: provides currency formatting logic
Agent activity
18 hits · last 30 days
node
14
Amazon
1
OpenAI (training)
1
Resources
ng-input-currency — npm install ng-input-currency · libregistry