Using validators to validate an email input
See original GitHub issuePLEASE MAKE SURE THAT:
- you searched similar issues online (9/10 issues in this repo are solved by googling, so please…do it)
- you provide an online demo I can see without having to replicate your environment
- you help me by debugging your issue, and if you can’t, do go on filling out this form
I’m submitting a … (check one with “x”)
[x ] bug report => search github for a similar issue or PR before submitting
[] support request/question
Notice: feature requests will be ignored, submit a PR if you'd like
Current behavior
When I’m trying to use validators to validate an email address, It gives me ‘ExpressionChangedAfterItHasBeenCheckedError’ from TagInputComponent.Html.
Expected behavior
Use validators to do our own validations. example - email, number or pattern matching.
Minimal reproduction of the problem with instructions (if applicable)
public validators = [this.emailValidation];
private emailValidation(control: any) { let sEmail = EmailValidator.validate(control.value); if (sEmail == false) { return { ‘emailValidation’: true }; } return null; }
What do you use to build your app?. Please specify the version
Webpack/ angular
Angular version:
5.0
ngx-chips version:
Latest as i installed it today (2018-05-01)
Browser: [all | Chrome XX | Firefox XX | IE XX | Safari XX | Mobile Chrome XX | Android X.X Web Browser | iOS XX Safari | iOS XX UIWebView | iOS XX WKWebView ]
All
Issue Analytics
- State:
- Created 5 years ago
- Comments:5 (1 by maintainers)
As for me all works fine.
in component ts
in component html
Hope its helps you.
suer