Skip to content
This repository was archived by the owner on Sep 5, 2024. It is now read-only.

Commit e435e09

Browse files
topherfangioThomasBurleson
authored andcommitted
fix(select): Allow 0 as default value.
A recent change introduced a bug which no longer allowed `0` as a valid `ng-value`. Fix by surrounding associated `if` code with `angular.isDefined(...)` to ensure `0` is treated as a valid value. Fixes #9232. Closes #9237
1 parent 8dcdf82 commit e435e09

File tree

2 files changed

+208
-193
lines changed

2 files changed

+208
-193
lines changed

src/components/select/select.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -816,7 +816,7 @@ function SelectMenuDirective($parse, $mdUtil, $mdConstant, $mdTheming) {
816816
// the current option, which will be added, then we can be sure, that the validation
817817
// of the option has occurred before the option was added properly.
818818
// This means, that we have to manually trigger a new validation of the current option.
819-
if (self.ngModel.$modelValue && self.hashGetter(self.ngModel.$modelValue) === hashKey) {
819+
if (angular.isDefined(self.ngModel.$modelValue) && self.hashGetter(self.ngModel.$modelValue) === hashKey) {
820820
self.ngModel.$validate();
821821
}
822822

0 commit comments

Comments
 (0)