We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
Similar to #12
Let's say we define a "password" validation like this:
password: ["", [Validators.required, CustomValidators.notEqualTo(email)]],
The notEqualTo validator's metadata includes the invalid value, so we can show this message:
notEqualTo
'password' cannot equal '[email protected]'
But, this is not informative. It should include the name of the target control (email), so that we can do this instead:
email
'password' cannot equal 'email'
That makes more sense.
So passwordControl.errors should return: { control: {}, otherControlName: 'email' }
passwordControl.errors
{ control: {}, otherControlName: 'email' }
The text was updated successfully, but these errors were encountered:
What's the goal?
To use the control name with a translation and display it to the user?
Sorry, something went wrong.
Yes, so you can use this:
Otherwise you don't know which control (i.e. email) it equalled.
No branches or pull requests
Similar to #12
Let's say we define a "password" validation like this:
The
notEqualTo
validator's metadata includes the invalid value, so we can show this message:But, this is not informative. It should include the name of the target control (
email
), so that we can do this instead:That makes more sense.
So
passwordControl.errors
should return:{ control: {}, otherControlName: 'email' }
The text was updated successfully, but these errors were encountered: