Skip to content

Commit

Permalink
partial fix for angular/angular.js#1553
Browse files Browse the repository at this point in the history
  • Loading branch information
_pants committed Nov 29, 2012
1 parent 4e850af commit 87c7390
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion app/lib/angular/angular.js
Original file line number Diff line number Diff line change
Expand Up @@ -14101,10 +14101,16 @@ var selectDirective = ['$compile', '$parse', function($compile, $parse) {
selectElement.bind('change', function() {
scope.$apply(function() {
var array = [];
forEach(selectElement.children(), function(option) {
function addIfSelected(option) {
if (option.selected) {
array.push(option.value);
}
}
forEach(selectElement.children(), function(child) {
if (child.tagName == 'OPTION')
addIfSelected(child);
else if (child.tagName == 'OPTGROUP')
forEach(child.getElementsByTagName('option'), addIfSelected);
});
ctrl.$setViewValue(array);
});
Expand Down

0 comments on commit 87c7390

Please sign in to comment.