Questions tagged [ngx-mask]

53 questions
12
votes
1 answer

How can i get ngx-mask masked value?

I'm trying to create simple field for phone number with help of ngx-mask module like this:
Kngh2
  • 387
  • 2
  • 4
  • 10
4
votes
2 answers

Angular currency editor

I need to make a form control in Angular that supports editing currency values with negative number support and full keyboard support so the user can tab between inputs, type a negative symbol and then enter the value. I have tried ngx-currency,…
Adrian Brand
  • 20,384
  • 4
  • 39
  • 60
4
votes
2 answers

ngx-mask Do not allow negative value for the currency input

I need to block the type of negative value and do not allow to type more numbers than 99,999,999.99 for my input. Here is the code which I am using for the currency input. Any…
Ashot Aleqsanyan
  • 4,252
  • 1
  • 15
  • 27
4
votes
2 answers

Angular - Input with ngx-mask MatDatepicker and reactive form

I would like to add a reactive form control over a form and an error is triggered: More than one custom value accessor matches form control with unspecified name attribute Everything works separately, reactive form validation, mask or…
3
votes
1 answer

Angular - Apply decimal pipe to an input

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…
Saad Iqbal
  • 98
  • 4
3
votes
2 answers

How to have thousand separator and decimal separator at once in ngx mask using angular7?

I have an angular7 app in which i have an input on which i have to apply mask using ngx-mask. I have the input like this It gives me result like…
ahsan
  • 277
  • 1
  • 5
  • 18
2
votes
1 answer

Problems with ngx-mask Angular 14.2.10

I'm having trouble using ngx-mask. My version is Angular 14.2.10. I put this in app.module.ts: import { NgxMaskModule } from 'ngx-mask'; @NgModule({ imports: [ NgxMaskModule.forRoot()]
Miriam
  • 57
  • 6
2
votes
0 answers

Min and Max values with ngx-mask package

How can I set Mininmal and Maximal values for input, using ngx-mask and RegExp patterns (for example, I need to set pattern for 0-20 only numbers). Is it possible to do with ngx-mask? In component.html:
2
votes
1 answer

Keep prefix even if dropSpecialCharacters is true with ngx-mask

With this code I'm already getting a value masked as +55 (11) 12345-6789, and in the form a value like…
strasso
  • 21
  • 3
2
votes
1 answer

NGX-Mask multiple masking on single input

I want to have multiple masking for zip code input to accept either 5 or 9 digits. If zipcode entered is 9 digit, it should automatically add hyphen(-) in the input. I tried optional masking(AAAAA-?A?A?A?A also tried AAAAA-A?A?A?A?) as they said in…
Faizan Saiyed
  • 804
  • 3
  • 17
  • 33
2
votes
0 answers

Angular Extend Directive with @Inputs

I'm trying to extend a MaskDirective from ngx-mask (https://www.npmjs.com/package/ngx-mask). My goal is to replace the functionality of So that all phone numbers in my application follow…
Ross Sullivan
  • 396
  • 1
  • 3
  • 13
1
vote
1 answer

I want to keep .0 when use ngx-mask in angular

when I use ngx-mask in angular, it automatically deletes .0 when server response 1.0, ex: 1.0 => 1 So I want to prevent this. 1.0 keep 1.0 not 1 when use ngx-mask
1
vote
1 answer

ngx-mask issue in Angular 9

I have used ngx-mask dynamically in my app by assigning a variable to it. This is nullable variable and input shows undefined when the variable is null or undefined. This is happening after I upgrade Angular from ver-8 to ver-9. It was working…
AShkANRed
  • 51
  • 1
  • 4
1
vote
0 answers

Add ngx-mask directive to existing Angular component class

Is there a way to add a directive - ngx-mask in my case - to an existing Angular component that has a named HTML element input (#datePicker in the example below)? Example setup Suppose I have a component called InputDate.component.ts as shown below.…
mohsenmadi
  • 2,277
  • 1
  • 23
  • 34
1
vote
1 answer

Angular ngx-mask - Value not formatted

I'm using this library ngx-mask and I'm trying to mask some fields (dates and phone numbers) in Angular 11 with Reactive Forms. Here are two snippets from my code
lsotov
  • 335
  • 1
  • 4
  • 13
1
2 3 4