A directive that adds regex pattern validation to controls marked with the
pattern attribute. The regex must match the entire control value. The directive is provided with the
NG_VALIDATORS multi-provider list.
Tracks changes to the pattern bound to this directive.
Adding a pattern validator
下面的例子演示了如何为一个带有 ngModel 绑定的输入框添加模式验证器。
The following example shows how to add a pattern validator to an input attached to an ngModel binding.