Package Exports
- mat-currency-format
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (mat-currency-format) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
MatCurrencyFormat
This library was generated with Angular CLI version 8.1.3.
Code scaffolding
Run ng generate component component-name --project mat-currency-format
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project mat-currency-format
.
Note: Don't forget to add
--project mat-currency-format
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build mat-currency-format
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build mat-currency-format
, go to the dist folder cd dist/mat-currency-format
and run npm publish
.
Running unit tests
Run ng test mat-currency-format
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
MatCurrencyFormat
This library was generated with Angular CLI version 8.1.3.
Code scaffolding
Run ng generate component component-name --project currency-format
to generate a new component. You can also use ng generate directive|pipe|service|class|guard|interface|enum|module --project currency-format
.
Note: Don't forget to add
--project currency-format
or else it will be added to the default project in yourangular.json
file.
Build
Run ng build currency-format
to build the project. The build artifacts will be stored in the dist/
directory.
Publishing
After building your library with ng build currency-format
, go to the dist folder cd dist/currency-format
and run npm publish
.
Running unit tests
Run ng test currency-format
to execute the unit tests via Karma.
Further help
To get more help on the Angular CLI use ng help
or go check out the Angular CLI README.
MatCurrencyFormat
This repos is creating a library for angular currency input and also it is showing how to use the library
This library was generated with Angular CLI version 8.1.3.
Installation - currency-format
$ npm i mat-currency-format
Description
The directive can be used in html input to automatically change the input to locale currency.
Input in any locale currency convert to number inside the component. On focus the user will see to type in number and on focus out the user will see the number in currency format with the support of internalization format and currency symbol
The selector name of the directive is localeCurrencyInput
The directive consists of two inputs:
- currencyCode (default value = 'USD')
- allowNegative (default value = false)
For more details , the project is inside projects/locale-currency-input.
Demo
- Demo Url: '-'
- The following steps is required to use this directives:
The module need to import
- import { CurrencyFormatModule } from 'currency-format';
Inside the view you need to call localeCurrencyInput and add input. Below is one of the example
<input type="text" mvndrMatCurrencyFormat [allowNegative]="false" [currencyCode]="'USD'" [value]="usAmount" (blur)="updateUSAmount($event)" />
Inside the component you can get the value by using event like blur or click or any other event. Below is one of the example updateUSAmount(event) { this.usAmount = event.target.value; }