You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Apr 12, 2024. It is now read-only.
If you define a select using a model with a value of 0, the "unknown option" will get added to the list and the proper selection in the will not be chosen. The problem is this line in self.removeOption:
https://github.com/angular/angular.js/blob/master/src/ng/directive/select.js#L215
if (ngModelCtrl.$viewValue == value) {
The double-equals check ends up evaluating 0 against the empty string, which succeeds and causes the "unknown option" to be rendered. This needs to be triple-equals, so that 0 really means 0.
I strongly suspect that the same should be the case in self.addOption in a similar circumstance. However, I have not found a situation in which the addOption code was problematic (which doesn't mean that none exists).
This bug exists minimally in 1.3.3 and 1.2.26.