我的输入看起来像这样:我只想使用输入掩码,而不是强制用户严格填充掩码中的模式。
<input type="text" class="Enter Zipcode" placeholder="Enter Zipcode" mask="00000-0000" formControlName="zipcode">默认情况下看起来像是根据documentation validation=true。但是应该通过某种方式将验证更改为false。当我这样做的时候
<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抛出模板解析错误?
发布于 2019-11-25 23:46:46
使用mask="99999-9999"。根据ngx-mask文档,0用于必填数字字段,9用于可选数字字段。
https://stackoverflow.com/questions/55466737
复制相似问题