Angular crmUiSelect cleanup
authorColeman Watts <coleman@civicrm.org>
Fri, 6 Mar 2015 20:10:22 +0000 (15:10 -0500)
committerColeman Watts <coleman@civicrm.org>
Fri, 6 Mar 2015 20:10:22 +0000 (15:10 -0500)
js/angular-crm-ui.js

index b810b39fce1dc43e95e63a6306b3a588f3a03f03..be4fb45a3d93a4d4ddac5cdea73ef25b580aa189 100644 (file)
       return {
         require: '?ngModel',
         scope: {
-          crmUiSelect: '@'
+          crmUiSelect: '='
         },
         link: function (scope, element, attrs, ngModel) {
           // In cases where UI initiates update, there may be an extra
 
           function init() {
             // TODO watch select2-options
-            var options = attrs.crmUiSelect ? scope.$parent.$eval(attrs.crmUiSelect) : {};
-            element.select2(options);
+            element.select2(scope.crmUiSelect || {});
             element.on('change', refreshModel);
             $timeout(ngModel.$render);
           }