@aipeel/mat-currency-field

Angular Material based currency form field

Usage no npm install needed!

<script type="module">
  import aipeelMatCurrencyField from 'https://cdn.skypack.dev/@aipeel/mat-currency-field';
</script>

README

@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">
     </mat-currency-field>

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