ngx-schema-form icon indicating copy to clipboard operation
ngx-schema-form copied to clipboard

How to have async custom validators?

Open stefdelec opened this issue 5 years ago • 0 comments

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);
    }

stefdelec avatar Jan 17 '20 15:01 stefdelec