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

view value is not using the latest selected option when using $validators #65

Closed
odiwodi opened this issue Jul 9, 2015 · 2 comments
Closed

Comments

@odiwodi
Copy link

odiwodi commented Jul 9, 2015

Hello! I have this directive that implements a validation using $validator. The validator successfully checks the model value upon changing, though the view value is delayed.

For an example, I have a dropdown with 3 options namely A, B, and C.
It should be valid when B or C is selected.
On initialization, the view is blank as its ngModel.
Issue comes when I select B, the view value is still "None Selected" but model value is B.
Then when I select A, the view value becomes B and the model value becomes A.
It correctly attaches the invalid state of the control, but the view value is delayed..

BTW, this is a great directive. Thanks! ;)

@odiwodi odiwodi changed the title view value is not updated when using $validators view value is not using the latest selected option when using $validators Jul 9, 2015
@odiwodi odiwodi closed this as completed Jul 15, 2015
@odiwodi
Copy link
Author

odiwodi commented Jul 15, 2015

I used $parser and $formatters instead of $validators, and luckily has fixed the issue.
I hope this can save someone's arse from hours of research in the future. :)

@lordfriend
Copy link
Owner

I think this is the fault of angular document
angular/angular.js#10035

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