class PatternValidator implements Validator, pattern : string ngOnChanges(changes: SimpleChanges) : void validate(c: AbstractControl) : {[key: string]: any} registerOnValidatorChange(fn: () => void) : void }
[pattern][formControlName]
[pattern][formControl]
[pattern][ngModel]
A Directive that adds the pattern
validator to any controls marked with the pattern
attribute, via the NG_VALIDATORS
binding. Uses attribute value as the regex to validate Control value against. Follows pattern attribute semantics; i.e. regex must match entire Control value.
<input [name]="fullName" pattern="[a-zA-Z ]*" ngModel>
pattern : string
ngOnChanges(changes: SimpleChanges) : void
validate(c: AbstractControl) : {[key: string]: any}
registerOnValidatorChange(fn: () => void) : void
exported from @angular/forms/index, defined in @angular/forms/src/directives/validators.ts
© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/forms/index/PatternValidator-directive.html