Skip to content
This repository was archived by the owner on Oct 2, 2019. It is now read-only.

Commit 8c5d0b9

Browse files
committed
initialize selected if undefined
1 parent 126c9e2 commit 8c5d0b9

File tree

5 files changed

+13
-7
lines changed

5 files changed

+13
-7
lines changed

dist/select.css

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.11.2 - 2015-04-27T15:06:50.902Z
4+
* Version: 0.11.2 - 2015-04-27T15:33:22.851Z
55
* License: MIT
66
*/
77

dist/select.js

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*!
22
* ui-select
33
* http://github.com/angular-ui/ui-select
4-
* Version: 0.11.2 - 2015-04-27T15:06:50.893Z
4+
* Version: 0.11.2 - 2015-04-27T15:33:22.845Z
55
* License: MIT
66
*/
77

@@ -1035,6 +1035,9 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
10351035
$select = $scope.$select,
10361036
ngModel;
10371037

1038+
if (angular.isUndefined($select.selected))
1039+
$select.selected = [];
1040+
10381041
//Wait for link fn to inject it
10391042
$scope.$evalAsync(function(){ ngModel = $scope.ngModel; });
10401043

@@ -1082,7 +1085,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
10821085

10831086
ctrl.getPlaceholder = function(){
10841087
//Refactor single?
1085-
if (!angular.isUndefined($select.selected) && $select.selected.length) return;
1088+
if ($select.selected.length) return;
10861089
return $select.placeholder;
10871090
};
10881091

dist/select.min.css

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/select.min.js

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/uiSelectMultipleDirective.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
99
$select = $scope.$select,
1010
ngModel;
1111

12+
if (angular.isUndefined($select.selected))
13+
$select.selected = [];
14+
1215
//Wait for link fn to inject it
1316
$scope.$evalAsync(function(){ ngModel = $scope.ngModel; });
1417

@@ -56,7 +59,7 @@ uis.directive('uiSelectMultiple', ['uiSelectMinErr','$timeout', function(uiSelec
5659

5760
ctrl.getPlaceholder = function(){
5861
//Refactor single?
59-
if (!angular.isUndefined($select.selected) && $select.selected.length) return;
62+
if ($select.selected.length) return;
6063
return $select.placeholder;
6164
};
6265

0 commit comments

Comments
 (0)