Provides a set of validators used by form controls.
A validator is a function that processes a Control or collection of controls and returns a map of errors. A null map means that validation has passed.
### Example
Control loginControl = new Control("", Validators.required)
Static Methods
-
compose(
List<ValidatorFn> validators) → ValidatorFn -
Compose multiple validators into a single function that returns the union of the individual error maps.
-
composeAsync(
List<AsyncValidatorFn> validators) → AsyncValidatorFn -
maxLength(
num maxLength) → ValidatorFn -
Validator that requires controls to have a value of a maximum length.
-
minLength(
num minLength) → ValidatorFn -
Validator that requires controls to have a value of a minimum length.
-
nullValidator(
AbstractControl c) → Map<String, bool> -
No-op validator.
-
pattern(
String pattern) → ValidatorFn -
Validator that requires a control to match a regex to its value.
-
required(
AbstractControl control) → Map<String, bool> -
Validator that requires controls to have a non-empty value.
Constructors
Properties
- hashCode → int
-
Get a hash code for this object.
read-only, inherited - runtimeType → Type
-
A representation of the runtime type of the object.
read-only, inherited
Operators
-
operator ==(
other) → bool -
The equality operator.
inherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a non-existent method or property is accessed.
inherited -
toString(
) → String -
Returns a string representation of this object.
inherited