This repository was archived by the owner on Apr 12, 2024. It is now read-only.
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
ngModel bound dropdown value changes visually while variable doesn't #7736
Closed
Description
By binding a dropdown to a variable, it would make sense for that variable to hold the selected option of the dropdown at all times. However, this is not the case. If you select an item in a dropdown, then refresh the list of items (via a variable in ng-options), if the selected item is not included in the new list it reverts back to the default option (visually) while ngModel bound variable holds the old selected value.
Here is a fiddle: http://jsfiddle.net/LUm7y/