我正试图用反应式的角度验证我的形式。
date
和
year
其中用户只输入
number
日期格式(01-31)年格式(1990-2019四位数字),所以他试图输入除字符串以外的任何内容,我需要显示无效消息。我这样做了
我在看什么样的图案
日期
和
年
图案
https://codesandbox.io/s/jzq6nn6zz9
cardnumber: ["", [Validators.required, Validators.pattern("[0-9]{16}")]],
dateofexipiredate: ["", [Validators.required]],
dateofexipireyear: [""],
cvc: ["", [Validators.required, Validators.pattern("[0-9]{3}")]]
什么样的模式
dateofexipiredate
和
dateofexipireyear