PatternValidator class

A Directive that adds a pattern validator to any controls with pattern:

<input ngControl="fullName" pattern="[a-zA-Z ]*" />

The attribute value is parsed and used as a RegExp to validate the control value against. The regular expression must match the entire control value.

Implemented types
Annotations
  • @Directive(selector: '' '[pattern][ngControl],' '[pattern][ngFormControl],' '[pattern][ngModel]', providers: [ExistingProvider.forToken(NG_VALIDATORS, PatternValidator)])

Constructors

PatternValidator()

Properties

hashCode int
The hash code for this object.
no setterinherited
pattern String
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() String
A string representation of this object.
inherited
validate(AbstractControl c) Map<String, dynamic>?
Returns a map of the errors associated with this control.
override

Operators

operator ==(Object other) bool
The equality operator.
inherited