MurlidharVarma / angular-mat-currency-field

Angular Material Component for currency field.

Home Page:https://www.npmjs.com/package/@aipeel/mat-currency-field

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

@aipeel/mat-currency-field

Angular Material based currency field. Works with material form field.

Demo

Installation

npm install @aiplee/mat-currency-field --save

Import the module

import { MatCurrencyFieldModule } from '@aipeel/mat-currency-field';
....

@NgModule({
  declarations: [...],
  imports: [
    ...
    MatCurrencyFieldModule
    ...
  ],
  providers: [...],
})
export class AppModule { }

Usage

    <mat-form-field>
      <mat-label>Currency in CAD <\/mat-label>
      
     <mat-currency-field  formControlName="currency" 
                          placeholder="Enter in CAD" 
                          currencyCode="CAD">
                          digitsInfo="1.2-2">
     </mat-currency-field>

      <mat-error *ngIf="frm.controls.currency.hasError('pattern')">
        Invalid Format
      </mat-error>
    </mat-form-field>

Logs

Version Change Logs
1.0.1 Initial Draft with Angular 10 support
2.0.0 Upgraded to Angular 12, Accept Negative value, Decimal digits format configuration, Currency code as space to show no Currency code
2.0.1 Remove the 2 decimal places validation from within library. Validation can be applied from Parent form itself. Updated example project to showcase new feature
3.0.0 Upgrade to Angular 15

NPM Link

https://www.npmjs.com/package/@aipeel/mat-currency-field

About

Angular Material Component for currency field.

https://www.npmjs.com/package/@aipeel/mat-currency-field


Languages

Language:TypeScript 71.3%Language:JavaScript 12.2%Language:HTML 9.6%Language:SCSS 6.9%