Issue
Just npm install ngx-currency, copy and paste into app.module.ts from section set option globally...,
import { CurrencyMaskInputMode, NgxCurrencyModule } from "ngx-currency";
import .... // other modules
export const customCurrencyMaskConfig = {
    align: "right",  allowNegative: true,  allowZero: true,  decimal: ",",
    precision: 2,  prefix: "R$ ",  suffix: "",  thousands: ".",
    nullable: true,
    min: null,
    max: null,
    inputMode: CurrencyMaskInputMode.FINANCIAL
}; 
@NgModule({
  imports: [
    NgxCurrencyModule.forRoot(customCurrencyMaskConfig), ...
  ]
})
ng serve complains
Types of property 'min' are incompatible. Type 'null' is not assignable to type 'number | undefined'
Angular v14.
Update
Removing min and max, or set them to undefined resulting from core.mjs:
ERROR NullInjectorError: R3InjectorError(PagesModule)[[object Object] -> [object Object] -> [object Object] -> [object Object]]: NullInjectorError: No provider for [object Object]!
Solution
In node_modules/ngx-currency/src/currency-mask.config.d.ts,
min?: number --> min?: number|null;
max?: number --> max?: number|null;
Answered By - Jeb50

0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.