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

ng:change doesn't always update the view [ng 10.2] #628

Closed
ktoso opened this issue Oct 27, 2011 · 2 comments
Closed

ng:change doesn't always update the view [ng 10.2] #628

ktoso opened this issue Oct 27, 2011 · 2 comments

Comments

@ktoso
Copy link

ktoso commented Oct 27, 2011

Hey guys,
I've bumped into a bug in angular 10.2.

Here's a js fiddle to show the problem: http://jsfiddle.net/ktoso/RRzKG/22/

The idea is to either enter a new name for something, or select it from the list.
If you select an item, the textbox should be cleared (the variable for it),
if you type in a name of a new category, the select box should be reset (and it's bound variable too of course).

Steps to reproduce:

  • enter some category name into the text box
  • select some category, it did reset the textbox just fine
  • now type some text into the texbox again
  • error the select box will not be reset, even though it's variable was nulled (and the log displays the right number of "clearing selected category code" messages).

Expected result:
The select box should be reset to the " -- choose category -- " element at all times when it's value is null.

Hack to fix it:
It's possible to hack-fix this issue by adding this.defer(); into the last line of each clear... method.

Update 1:
The same thing is happening when implemented using $watch.

Update 2:
It's supposedly working in 10.4 hmmm... So maybe it's a non issue I guess.

Thanks a lot in advance for taking a look at it.

Cheers 🍺,
Konrad

@psyho
Copy link

psyho commented Oct 27, 2011

This works in 0.10.4

@vojtajina
Copy link
Contributor

Thanks for nice report !
Fortunately, this issue has been fixed in 0.10.4, check out this updated fiddle: http://jsfiddle.net/vojtajina/RRzKG/23/

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

No branches or pull requests

3 participants