Questions tagged [ngx-mask]
The ngx-mask tag has no usage guidance.
54
questions
0
votes
0
answers
23
views
Dot as a first character ( .90 ) with ngx-mask
I was trying to use ngx-mask in Angular 15 application here is my textbox looks like
<input type="text" [(ngModel)]="sharePrice" mask="separator.4" separatorLimit=&...
0
votes
0
answers
184
views
How to solve error "export 'MaskDirective' (imported as 'i3') was not found in ngx-mask" for Azure DevOps pipeline?
While building the angular app on azure devops pipeline getting an error related to ngx-mask. But on local it is working fine.
The error is:-
./node_modules/cdp-angular-controls/fesm2020/cdp-angular-...
3
votes
1
answer
243
views
NG-Zorro Datepicker Manual Input Mask not working
I need to mask the datepicker as MM/dd/yyyy and my users do not want to manually type out the /character. They want to be able to enter in just the numbers and the masking works on its own.
I have ...
0
votes
1
answer
699
views
ngx-mask v16.2.6 upgrade - Module '"ngx-mask"' has no exported member 'NgxMaskModule'
I recently upgraded ngx-mask to version 16.2.6, and after the upgrade, I'm facing an issue where the Angular compiler can't find NgxMaskModule exported from 'ngx-mask'.
The error message I'm receiving ...
0
votes
0
answers
70
views
Min and Max with ngx mask
Is is possible to set a min and max values with ngx mask? and can we use ngx mask with input = "number" also?
As per the documentation it have specified example for input = "text".
0
votes
0
answers
542
views
NGX-Mask special characters
I have a functionality where I defined custom pattern and it should allow user to enter any alphabets, numbers, spaces and special characters. In this example lets say $
At the same time I have '$' as ...
0
votes
3
answers
318
views
How to make an universal postcode mask for ngx-mask input?
I use ngx-mask 14.2.4. I want to allow the following conditions for my postcode input field:
between 2 and 12 signs
allow letters, numbers and '-'. Also allow spaces but not after '-'.
I tried:
<...
0
votes
0
answers
525
views
How to add custom mask in Angular using ngx-mask?
I am trying to add a custom mask in angular using regular expression.
Here is the mask I want:
Characters allowed: Capital Letters, Small Letters, and Numbers
Length of the field: 20
Can start the ...
0
votes
0
answers
345
views
NGX-MASK Masking
I am using ngx-mask to implement masking in my angular application.
https://github.com/JsDaddy/ngx-mask.
My requirement is whenever user types alphabets either in small case or upper case, mask should ...
0
votes
0
answers
136
views
NullInjectorError using ngs-mask in angular
I want to create input field in angular, it is customized:
<cs-input [field]="inputname" formControlName="inputname"></cs-input>
the .ts file has declaration:
...
0
votes
0
answers
437
views
Using ngx-mask in angular to display mask '00.00'
I am trying to use ngx-mask to complete this task. Almost there, but i am not able to figure it out the last part.
So i have following input:
<input
type="text"
mask="00.00&...
0
votes
0
answers
459
views
Formatting number with ngx-mask
i try to format number value using ngx-mask pipe.
So input data is: 284 and output should be 000284. and for eg. input 3 should be shown like 000003. did some one now how format for this case should ...
0
votes
1
answer
941
views
Mask date field in angular input
I'm trying to mask the DOB input field so that on the screen user can only see **/**/****. the input field is already using bsDatePicker.
I tried to add ngx-mask to mask it like this.
<input type=&...
0
votes
1
answer
435
views
Angular: Display time in template with mask using a pipe
I have this pipe, secondsToHms, to convert from seconds to hours, minutes and seconds:
transform(seconds: number): string {
const minutes = Math.floor(seconds / 60); //minutes
const secs = seconds ...
0
votes
3
answers
8k
views
Angular 11 Module '"ngx-mask"' has no exported member 'NgxMaskModule'
I am running Angular 11. I have not taken any action relating to updating Angular versions; I only installed one new package which is not working.
I ran npm i --save ngx-mask and it successfully ...
2
votes
1
answer
3k
views
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()]
1
vote
1
answer
871
views
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
0
votes
1
answer
1k
views
ngx-mask don't work properly after updateValueAndValidity on the input control, angular 11
I have an input using the ngx-mask
<input type="text" [mask]="maskPhoneFormat" formControlName="contactPhone" />
In the ts file I use: this.contactPopupForm.get('...
-1
votes
1
answer
322
views
error TS2322: Type 'null' is not assignable to type 'Partial<IConfig> | (() => Partial<IConfig>)'
Installed and followed Quickstart instructions of ngx-mask for app.module.ts:
import { NgxMaskModule, IConfig } from 'ngx-mask'
export const options: Partial<IConfig> | (() => Partial<...
0
votes
1
answer
324
views
Have "APP" as prefix and then allow only numbers in input field
I have a requirement where I have an input field, that must have the prefix "APP " and then allow the user to type in 7 numeric only values. I was hoping I could use ngx-mask, but it doesn't ...
1
vote
1
answer
1k
views
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 ...
0
votes
1
answer
855
views
Angular ngx mask issue when mask has multiple optional numbers (9)
I'm trying to implement a mask for iban input.
The mask is "SS00 AAAA 0000 0000 0000 9999 9999 9999 99".
For some reason the mask bugs out when the optional numbers come in.
It'll display a ...
0
votes
0
answers
1k
views
Show Today in a mat-datepicker while keeping the date value
I am using Angular 12 and Angular Material Datepicker, and I want to be able to show strings like "Today" or "Current" when the selected date meets a condition. However I do not ...
0
votes
1
answer
983
views
I am trying to change the default promptCharacter in ngxMask in angular
I am using ngxmask in Angular to display the phone number in the following pattern:
(000) 000-0000
I set showMaskTyped Property to true to always display the mask pattern in the input which looks as ...
2
votes
0
answers
2k
views
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....
2
votes
1
answer
1k
views
Keep prefix even if dropSpecialCharacters is true with ngx-mask
<input matInput prefix="+55" mask=" (00) 00000-0000" [dropSpecialCharacters]="true" type="text" formControlName="phone" name="phone">
...
0
votes
0
answers
1k
views
Angular 13 / ngx-mask thousand seperator mask
Hello i am using the following ngx mask template:
<input
class="form-control"
type="text"
mask="separator.2"
thousandSeparator=&...
0
votes
0
answers
2k
views
Angular - ngx-mask - convert mask to number
I am using ngx-mask like this:
<input type="text" class="form-control"
id="price"
name=&...
3
votes
1
answer
3k
views
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 ...
0
votes
1
answer
2k
views
Is there any way to allow input dot and comma as decimal marker?
specific question!
Is there a way to allow user to input comma and dot as a decimal marker, but keep the dot in displayed value and then trim thousand separators?
User inputs "123456,78", ...
0
votes
1
answer
3k
views
Why can't I dynamically update the mask of an input using ng-neat input-mask?
I'm currently playing around with a stackblitz here: https://stackblitz.com/edit/angular-ivy-qr7yav?file=src%2Fapp%2Fanother.component.html
With both ng-neat's input-mask found here https://github.com/...
0
votes
0
answers
915
views
How to mask input "(500)-000-0000" with ngx-mask?
I am using ngx-mask in my project. Normally I defined my phone number's mask like this: "(000)-000-0000)". But I am wondering how can I do it like this: "(500)-000-0000)"? When I ...
1
vote
0
answers
1k
views
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 ...
0
votes
1
answer
2k
views
How do you mask a decimal with optional integer ngx-mask
I'm working with ngx-mask v11.1.5 and am having difficulty creating a mask that allows both leading integers and omitted integers. For instance, both ".5" and "0.5" should be ...
2
votes
1
answer
5k
views
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
<input type="text" class=...
1
vote
0
answers
1k
views
Angular ngx-mask prefilled data missing 0 when using suffix
I have a component which display a formgroup input field. I am also using ngx-mask with the following
setup in .ts:
mask: string = "separator,"
thousandSeparator: string = "."
...
4
votes
2
answers
4k
views
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 ...
0
votes
0
answers
4k
views
How can i work with custom regex on ngx-mask in Angular? Using Lat/Lon coords
i need some help to work with regex on ngx Mask.
I'm trying to set a mask to my Lat,Lon google coords input with a custom regex.
-5.57455948, -70.5165755
This Regex fit the entire input:
/^([-+]?[1-8]?...
0
votes
2
answers
19k
views
ngx-mask - Simple Decimal Mask Not working
I would like a textbox that allows only 2 decimals. I am using https://github.com/JsDaddy/ngx-mask/ to achieve this.
This example ( using Angular 8 and an older mask version ) works , but looks like ...
2
votes
1
answer
914
views
value directive is not binding when use mask in Angular
<input type="text" class="form-control" [value]="phoneVariable" mask="000-000-0000"/>
[value] is not working when I use mask in the input tag in Angular.
...
0
votes
1
answer
4k
views
Angular 9 dynamic ngx-mask issue
I have the following input
<input
[(ngModel)]="myInput"
mask="00-0000-0000||00-00000-0000"
type="text"
>
and I would like to initialize it with a certain ...
4
votes
2
answers
9k
views
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.
<input mask="...
2
votes
1
answer
3k
views
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?...
3
votes
2
answers
11k
views
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
<input matInput mask="separator.2" thousandSeparator="," [(ngModel)]="...
0
votes
0
answers
3k
views
NGX MASK optionals alphanumerics take wrong spot
After several tries, I haven't found solutions, i would like make a mask.
Here is my problem:
My mask is composed:
3 numbers required
1 space required
1 alphanumeric required
1 letter not required
...
0
votes
1
answer
1k
views
What does Angular FormControl value actually hold and why is it different from the nativeElement value?
Update: logging blur and keyup events shows that the mask never makes it into the FormControl value. Why is that? Even calling the setValue() method on the control itself strips out the mask. Like:
&...
1
vote
1
answer
2k
views
Angular Nebular nbInput - Add mask into input fields
I need to add mask into input text fields (phone, date, email, etc).
I'm using Angular and Nebular 5.0.0, and according to the official documentation, there is no mask attribute available.
I had tried ...
0
votes
1
answer
184
views
How to clear all the values using ctrl+Z after numer being typed in angula8 using ngx-mask
mask for phone number field but here if i type some numbers and do ctrl+Z, it is not clearing all the values, when i do ctrlZ after typing, it must clear all the values present in it.
DEMO:
DEMO
TS:...
4
votes
2
answers
12k
views
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 ...
12
votes
1
answer
18k
views
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:
<mat-form-field>
<input matInput formControlName="PhoneNumber" placeholder="Phone ...