Skip to content

Commit

Permalink
Fix: selected items doesn't change in remote config
Browse files Browse the repository at this point in the history
See #34
  • Loading branch information
indrimuska committed Mar 29, 2016
1 parent 0786b35 commit 71ee8c1
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 9 deletions.
2 changes: 1 addition & 1 deletion bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "angular-selector",
"version": "1.3.2",
"version": "1.3.3",
"authors": [
"Indri Muska <indrimuska@gmail.com>"
],
Expand Down
6 changes: 4 additions & 2 deletions dist/angular-selector.js
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,7 @@
initDeferred = $q.defer(),
defaults = {
api: {},
search: '',
selectedValues: [],
highlighted: 0,
valueAttr: null,
Expand Down Expand Up @@ -399,7 +400,7 @@
: { newValue: newValue[0], oldValue: oldValue[0] });
}, true);
scope.$watchCollection('options', function (newValue, oldValue) {
if (angular.equals(newValue, oldValue) || scope.remote) return;
if (angular.equals(newValue, oldValue)) return;
scope.updateSelected();
});

Expand All @@ -414,9 +415,10 @@
}).filter(function (value) { return angular.isDefined(value); });
};
scope.$watch('value', function (newValue, oldValue) {
if (angular.equals(newValue, oldValue) || scope.remote) return;
if (angular.equals(newValue, oldValue)) return;
scope.updateSelected();
scope.filterSelected();
scope.updateValue();
}, true);

// DOM event listeners
Expand Down
Loading

0 comments on commit 71ee8c1

Please sign in to comment.