3

I want to apply decimal pipe on an input so the user can see comma separated numbers as he/she types. I have tried the ngx-mask but that only works if you type in the input. When you patch a value to the input it doesn't transform the value into decimal format.

Saad Iqbal
  • 98
  • 4

1 Answers1

1

Basically you can use ngModelChange when you value change you can use a pipe in your ngModel as below

<input [ngModel]="item.value | currency" (ngModelChange)="item.value=$event"
name="name" type="text" />

and more detail about it check this

errorau
  • 2,121
  • 1
  • 14
  • 38