diff --git a/dist/angular-selectize.js b/dist/angular-selectize.js index a009975..a8d9102 100755 --- a/dist/angular-selectize.js +++ b/dist/angular-selectize.js @@ -25,7 +25,7 @@ angular.module('selectize', []).value('selectizeConfig', {}).directive("selectiz } var validate = function() { - var isInvalid = (scope.ngRequired() || attrs.required || settings.required) && isEmpty(scope.ngModel); + var isInvalid = (scope.ngRequired() || attrs.required || settings.required) && isEmpty(modelCtrl.$modelValue); modelCtrl.$setValidity('required', !isInvalid); }; @@ -51,8 +51,8 @@ angular.module('selectize', []).value('selectizeConfig', {}).directive("selectiz selectize.$control.toggleClass('ng-dirty', modelCtrl.$dirty); selectize.$control.toggleClass('ng-pristine', modelCtrl.$pristine); - if (!angular.equals(selectize.items, scope.ngModel)) { - selectize.setValue(scope.ngModel, true); + if (!angular.equals(selectize.items, modelCtrl.$modelValue)) { + selectize.setValue(modelCtrl.$modelValue, true); } }