ifValidator / ifAsyncValidator
Created by Tomer
Import
Usage
ifValidator
Use ifValidator
to apply conditional form validation. It accepts a callback condition and ValidatorFn
or ValidatorFn[]
.
ifAsyncValidator
Similar to ifValidator
but for asynchronous validation.
API
Inputs for ifValidator
condition: (control: FormControl) => boolean
- A callback to determine whether the validators should be applied.validatorFn: ValidatorFn | ValidatorFn[]
- The validation function(s) to use.
Inputs for ifAsyncValidator
condition: (control: FormControl) => boolean
- A callback to determine whether the asynchronous validator should be applied.validatorFn: AsyncValidatorFn
- The asynchronous validation function to use.