Validator • Angular
An interface implemented by classes that perform synchronous validation.
validate
ValidationErrors | nullMethod that performs synchronous validation against the provided control.
@paramcontrolAbstractControl<any, any, any>
The control to validate against.
registerOnValidatorChange
voidRegisters a callback function to call when the validator inputs change.
@paramfn() => void
The callback function
@returnsvoid
Usage Notes
Provide a custom validator
The following example implements the Validator interface to create a
validator directive with a custom error key.