Skip to content
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

Can you make min and max error to include required min or max value like the build in min/max length validators #74

Open
Pakooo opened this issue Apr 10, 2017 · 1 comment

Comments

@Pakooo
Copy link

Pakooo commented Apr 10, 2017

Can you make min and max error to include required min or max value like the build in min/max length validators. We develop custom error message component which is bind to form component & listen the component errors.

minlength: {actualLength : 1, requiredLength : 5}

@atomdmac
Copy link

atomdmac commented Oct 23, 2017

While it looks like some work has been done to make this possible, the data structure of ng2-validators output doesn't seem to match that of the built-in validators. For example:

Built-In Validators:

{
  myErrorName: {
    actualValue: [the actual input value].
    requiredValue: [the required value given to the validator]
  }
}

ng2-validators

{
  myErrorName: true,
  actualValue: [the actual input value],
  requiredValue: [the required value given to the validator]
}

As it is, the ng2-validators version doesn't appear to be able to support requiredValues for multiple errors.

Does anyone know if this was intentional? Am I missing something?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants