Skip to content
This repository was archived by the owner on Apr 12, 2024. It is now read-only.

Binding breaks down for input type url and email. #8167

Closed
gleb-svechnikov opened this issue Jul 12, 2014 · 3 comments
Closed

Binding breaks down for input type url and email. #8167

gleb-svechnikov opened this issue Jul 12, 2014 · 3 comments

Comments

@gleb-svechnikov
Copy link

Here is a JSFiddle fork of Miško example for issue #1466. It is reproducible on all stable versions of Angular. It doesn't work for type url and email, however works with type text, search, tel.

@caitp
Copy link
Contributor

caitp commented Jul 12, 2014

@gleb-svechnikov invalid values have an undefined value, and the change listeners won't be called if the value changes from invalid -> invalid, because the value looks like it hasn't changed. This is still true in more recent versions of angular.

This is working as expected... the model value is undefined while invalid, and the {{debug}} binding won't show it because interpolation uses toJson() for object values, and toJson() won't serialize undefined properties.

@caitp
Copy link
Contributor

caitp commented Jul 12, 2014

If you want to render something useful, a good thing to render in this case is some kind of way of notifying the user that their input is invalid. Here's an example: http://www.yearofmoo.com/2014/05/how-to-use-ngmessages-in-angularjs.html

@gleb-svechnikov
Copy link
Author

@caitp thank you for fast response. I just wrote an issue before got notification of you reply :)

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

No branches or pull requests

2 participants