aboutsummaryrefslogtreecommitdiffstats
path: root/src/ng/directive/select.js
diff options
context:
space:
mode:
Diffstat (limited to 'src/ng/directive/select.js')
-rw-r--r--src/ng/directive/select.js7
1 files changed, 5 insertions, 2 deletions
diff --git a/src/ng/directive/select.js b/src/ng/directive/select.js
index 0c94ddcb..e6e0ced7 100644
--- a/src/ng/directive/select.js
+++ b/src/ng/directive/select.js
@@ -386,7 +386,8 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
selected,
selectedSet = false, // nothing is selected yet
lastElement,
- element;
+ element,
+ label;
if (multiple) {
selectedSet = new HashMap(modelValue);
@@ -410,9 +411,11 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
selected = modelValue === valueFn(scope, locals);
selectedSet = selectedSet || selected; // see if at least one item is selected
}
+ label = displayFn(scope, locals); // what will be seen by the user
+ label = label === undefined ? '' : label; // doing displayFn(scope, locals) || '' overwrites zero values
optionGroup.push({
id: keyName ? keys[index] : index, // either the index into array or key from object
- label: displayFn(scope, locals) || '', // what will be seen by the user
+ label: label,
selected: selected // determine if we should be selected
});
}