diff options
| author | Misko Hevery | 2012-02-03 10:34:16 -0800 |
|---|---|---|
| committer | Misko Hevery | 2012-02-21 22:45:59 -0800 |
| commit | 85b2084f578652cc0dcba46c689683fc550554fe (patch) | |
| tree | dae850e1da51fdd975cfa20c725fe25ec85a0b00 /src | |
| parent | 13b21aaf5ac7267288fd94a50ece9a1f1ec2e379 (diff) | |
| download | angular.js-85b2084f578652cc0dcba46c689683fc550554fe.tar.bz2 | |
fix(select): double array issue with multislect and jQuery
Diffstat (limited to 'src')
| -rw-r--r-- | src/widget/select.js | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/widget/select.js b/src/widget/select.js index 332009d2..9f8faff2 100644 --- a/src/widget/select.js +++ b/src/widget/select.js @@ -243,9 +243,8 @@ var selectDirective = ['$formFactory', '$compile', '$parse', widget.$apply(function() { var optionGroup, collection = valuesFn(modelScope) || [], - key = selectElement.val(), tempScope = inherit(modelScope), - value, optionElement, index, groupIndex, length, groupLength; + key, value, optionElement, index, groupIndex, length, groupLength; if (multiple) { value = []; @@ -257,13 +256,15 @@ var selectDirective = ['$formFactory', '$compile', '$parse', for(index = 1, length = optionGroup.length; index < length; index++) { if ((optionElement = optionGroup[index].element)[0].selected) { + key = optionElement.val(); if (keyName) tempScope[keyName] = key; - tempScope[valueName] = collection[optionElement.val()]; + tempScope[valueName] = collection[key]; value.push(valueFn(tempScope)); } } } } else { + key = selectElement.val(); if (key == '?') { value = undefined; } else if (key == ''){ |
