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>
Errors
Common errors & fixes
formatAsCurrency is not defined
Missing format-as-currency dependency script.
fixInclude <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.
fixEnsure 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.
fixAdd the script tag for format-as-currency before ng-input-currency.
Audit
Dependencies
angularrequiredpeer dependency: AngularJS 1.x
format-as-currencyrequiredruntime dependency: provides currency formatting logic