Skip to content

Commit 0c1764a

Browse files
author
Vytas
committed
Update uiSelectMultipleDirective.js
This code needs testing, but seems like it solves all the issues with $select.selected being undefined, because on $render $select.selected is assigned model's $viewValue before $watch in uiSelectSingleDirective.js#L42 sets the $viewValue to empty array in case $select.selected was undefined.
1 parent 9d29307 commit 0c1764a

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/uiSelectMultipleDirective.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,9 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
163163
} else {
164164
throw uiSelectMinErr('multiarr', "Expected model value to be array but got '{0}'", ngModel.$viewValue);
165165
}
166+
} else {
167+
$select.selected = ngModel.$viewValue;
166168
}
167-
$select.selected = ngModel.$viewValue;
168169
$selectMultiple.refreshComponent();
169170
scope.$evalAsync(); //To force $digest
170171
};

0 commit comments

Comments
 (0)