angular/angular.js — Issue #628: ng:change doesn't always update the view [ng 10.2]
Author: ktoso
Created: 2011-10-27 15:11:50+00:00
State: open

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.

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

Cheers :beer:,
Konrad