ngx-schema-form
ngx-schema-form copied to clipboard
How to have async custom validators?
How to have async custom validators? From your example :
myValidators = {
"/passwordCheck": (value, property, form) => {
const passwordProperty = formProperty.findRoot().getProperty('password')
if (passwordProperty.value !== undefined && property.valid && value !== passwordProperty.value) {
return Promise.resolve({ "passwordCheck": { "expectedValue": "same as 'password'" } })
}
return Promise.resolve(null);
}