Skip to content
This repository was archived by the owner on Sep 8, 2020. It is now read-only.

Commit 32b4fdf

Browse files
author
nroe
committed
Set $isEmpty function on model controller for hidden inputs that allow multiple, Fixes #40
1 parent 4469fd7 commit 32b4fdf

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/select2.js

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ angular.module('ui.select2', []).value('uiSelect2Config', {}).directive('uiSelec
9696
elm.select2('val', controller.$viewValue);
9797
} else {
9898
if (opts.multiple) {
99+
controller.$isEmpty = function (value) {
100+
return !value || value.length === 0;
101+
};
99102
var viewValue = controller.$viewValue;
100103
if (angular.isString(viewValue)) {
101104
viewValue = viewValue.split(',');

0 commit comments

Comments
 (0)