Permalink
Browse files

Attempted fix for #135 and #193

  • Loading branch information...
1 parent 1096f84 commit 47be18ecea4232b106953ad92b84c648e757a2c6 Dean Sofer committed Dec 8, 2012
Showing with 3 additions and 1 deletion.
  1. +3 −1 modules/directives/select2/select2.js
@@ -49,8 +49,10 @@ angular.module('ui.directives').directive('uiSelect2', ['ui.config', '$http', fu
} else {
if (isMultiple && !controller.$modelValue) {
elm.select2('data', []);
- } else {
+ } else if (angular.isObject(controller.$modelValue)) {
elm.select2('data', controller.$modelValue);
+ } else {
+ elm.select2('val', controller.$modelValue);
}
}
};

0 comments on commit 47be18e

Please sign in to comment.