You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Validator.email may need some rework - Or a new universal email validator is required #17296
Current behavior
Create a new email validator that validates the FQDN (in a routable sense) as well
Expected behavior
An email validator that finds root@localhost invalid, page@google invalid, but validates [email protected]
Minimal reproduction of the problem with instructions
Create a minimal form and add Validator.email as a synchronous validator.
What is the motivation/use case for changing the behavior?
While root@localhost is a valid email address, 99% of the usage cases "may" require the FQDN in the email to be validated.
Please tell us about your environment:
ng: 4.2.0-rc.2
@angular/cli: 1.1.0-rc.0
node: 6.9.5
os: darwin x64
browser: chrome
Note:
My hope is that this request is not just close with a few links to other issues raised against the current email validator. True; root@localhost is valid. No question about it.
However, the current email validator is 99% unusable to accommodate the 1% need for emails such as root@localhost. Send an email to page@google and see if Larry is going to get it.
Address not found
Your message wasn't delivered to page@google because the domain google couldn't be found. Check for typos or unnecessary spaces and try again.
The problem is that the 1% need is checked first in the current validator and therefore it will make the form valid and submittable, even though the probability of the email being invalid is 99%.
So statistically speaking, we (perhaps) need another validator that sees page@google invalid and won't allow our users send an email where the recipient is not found.
Once again, this is a feature request for a new email validator so developers have a choice. Where developers can use the existing Validators.email or perhaps simply use the new, let's say "Validators.routableEmail"!
@tytskyi I already use my own version within my own code space. So no immediate need. But for the sake of DRY and not copying the same code into all future projects, it would be great to have it come from a single package. Something like @angular/contrib should be good. Contributed by others, blessed by @angular team.
@angular/contrib could be cool. Generally i would like to not have angular core extended - more features means more bugs and more maintenance. This potentially would postpone releases of the core.
@tytskyi not really, neither @angular/material nor @angular/flex-layout have any direct postponement power over @angular/core. @angular/contrib should not have any either. It was just an idea as many packages &| frameworks also have the contrib portion.
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
Activity
tytskyi commentedon Jun 7, 2017
Would you be happy if we have validator that does what you described, but goes as a separate package in npm?
un33k commentedon Jun 7, 2017
@tytskyi I already use my own version within my own code space. So no immediate need. But for the sake of DRY and not copying the same code into all future projects, it would be great to have it come from a single package. Something like @angular/contrib should be good. Contributed by others, blessed by @angular team.
tytskyi commentedon Jun 9, 2017
@angular/contribcould be cool. Generally i would like to not have angular core extended - more features means more bugs and more maintenance. This potentially would postpone releases of the core.un33k commentedon Jun 19, 2017
@tytskyi not really, neither
@angular/materialnor@angular/flex-layouthave any direct postponement power over @angular/core.@angular/contribshould not have any either. It was just an idea as many packages &| frameworks also have thecontribportion.tytskyi commentedon Jun 19, 2017
@un33k i meant it will add overhead if implemented under
@angular/formdirectly. I am both hands for@angular/contribBioPhoton commentedon Aug 9, 2017
This sounds amazing!!
scottseeker commentedon Jan 7, 2019
The local part of the e-mail validation is not coded to the RFC. For instance, \ and " characters immediately cause the validator to fail.
xaviergxf commentedon Nov 1, 2019
Any news about changing the current behavior?
trotyl commentedon Nov 1, 2019
@xaviergxf The current behavior is expected, see #32961.
Most importantly,
angular-robot commentedon Jun 4, 2021
Just a heads up that we kicked off a community voting process for your feature request. There are 20 days until the voting process ends.
Find more details about Angular's feature request process in our documentation.
angular-robot commentedon Jun 24, 2021
Thank you for submitting your feature request! Looks like during the polling process it didn't collect a sufficient number of votes to move to the next stage.
We want to keep Angular rich and ergonomic and at the same time be mindful about its scope and learning journey. If you think your request could live outside Angular's scope, we'd encourage you to collaborate with the community on publishing it as an open source package.
You can find more details about the feature request process in our documentation.
angular-automatic-lock-bot commentedon Jul 26, 2021
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.