-
Notifications
You must be signed in to change notification settings - Fork 365
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Unable to make http call in customValidator #1170
Comments
Hello @aditya-sawant-dev , I am pretty sure you need to add this kind of validator to the "asyncValidators" property instead of the "validators" property. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I'm submitting a
I'm using
Description
When i am creating custom validator using following code :
export function myCustomValidator(control: AbstractControl): ValidationErrors | null {
const hasError = control.value ? (control.value as string).startsWith("abc") : false;
return hasError ? {myCustomValidator: true} : null;
}
new DynamicInputModel({
id: "myInput",
label: "My Input",
validators: {
myCustomValidator: {
name: myCustomValidator.name,
args: null
}
}
})
Now in myCustomValidator Method I am unable to do http call. So we must include a feature that allows us to do http call in custom validator.
In above dynamicinputmodel there is customvalidator object which contains "args". What value can we provide in args ?
Thank you.
The text was updated successfully, but these errors were encountered: