Skip to content

Commit

Permalink
fix wrong filtering in conditions angular app
Browse files Browse the repository at this point in the history
  • Loading branch information
jochenklar committed Apr 6, 2017
1 parent 2ac9720 commit 775a596
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions apps/conditions/static/conditions/js/conditions.js
Original file line number Diff line number Diff line change
Expand Up @@ -112,8 +112,12 @@ angular.module('conditions', ['core'])

service.getOptions = function() {
if (angular.isDefined(service.values) && angular.isDefined(service.values.source)) {
attribute = $filter('filter')(service.attributes, {id: service.values.source})[0];
return attribute.options;
var attributes = $filter('filter')(service.attributes, {id: service.values.source});
for (var i = 0; i < attributes.length; i++) {
if (attributes[i].id == service.values.source) {
return attributes[i].options;
}
}
}
};

Expand Down

0 comments on commit 775a596

Please sign in to comment.