1
2
你需要使用指令。在指令中,添加有关输入的热侦听器,并检查是否与指示的regexpr匹配。 我前段时间做了一个指令性的面具。指令 the stackblitz ,前提是本规范按“原样”提供,无任何形式的保证。
当你在一个字符串中(或在HTML中)写“mask”时,要小心。例如,对于数字宽度,两个小数是:
(必须将\写为\,写为\,,写为\…) |
2
1
您可以使用HTML5功能,regex输入 使用regex模式验证:
您还可以使用此库,用键装饰输入:
回购:github.com/alphagit/ng-pattern-restrict |
Kiara · 根据条件角度显示多个模板 1 年前 |
IonicMan · 剑道网格在宽度过大时不显示某些列 1 年前 |
Ben5 · 服务器端总是接触FormControl 1 年前 |
allforthenoob · 我该怎么分类? 1 年前 |
Hugh Jones · 如何创建适用于多个来源的自签名开发证书 1 年前 |
jthorn · 角度对象未在HTML中显示 1 年前 |
clem · 如何在Angular应用程序中突出显示页面的一部分? 1 年前 |
Kael · 在html表格中显示关系api数据-角度 2 年前 |