Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Ngx-mask Enforcing Validation on Input fields in production

My Input looks like this: I just want to use input mask but not enforce the user to strictly fill the pattern in the mask.

<input type="text" class="Enter Zipcode" placeholder="Enter Zipcode" mask="00000-0000" formControlName="zipcode">

Seems like according to documentation [validation]=true by default. But should be some way to change validation to false. When I do it

<input type="text" class="Enter Zipcode" placeholder="Enter Zipcode" mask="00000-0000" formControlName="zipcode" [validation]="true">

ERROR Error: Uncaught (in promise): Error: Template parse errors:
Can't bind to 'validation' since it isn't a known property of 'input'. ("text" class="Enter Zipcode" placeholder="Enter Zipcode" mask="00000-0000" formControlName="zipcode" [ERROR ->][validation]="false">

Angular throws template parse errors ?

like image 395
GURURAJ DHARANI Avatar asked Apr 02 '19 03:04

GURURAJ DHARANI


1 Answers

Use mask="99999-9999". According to ngx-mask documentation the 0's are used for required numeric fields and the 9's for optional numeric fields.

like image 93
theExterminator Avatar answered Oct 16 '22 20:10

theExterminator