{"action":"opened","issue":{"url":"https://api.github.com/repos/mistic100/jQuery-QueryBuilder/issues/188","labels_url":"https://api.github.com/repos/mistic100/jQuery-QueryBuilder/issues/188/labels{/name}","comments_url":"https://api.github.com/repos/mistic100/jQuery-QueryBuilder/issues/188/comments","events_url":"https://api.github.com/repos/mistic100/jQuery-QueryBuilder/issues/188/events","html_url":"https://github.com/mistic100/jQuery-QueryBuilder/issues/188","id":112507999,"number":188,"title":"How to use ajax for get values?","user":{"login":"velykov","id":14268723,"avatar_url":"https://avatars.githubusercontent.com/u/14268723?v=3","gravatar_id":"","url":"https://api.github.com/users/velykov","html_url":"https://github.com/velykov","followers_url":"https://api.github.com/users/velykov/followers","following_url":"https://api.github.com/users/velykov/following{/other_user}","gists_url":"https://api.github.com/users/velykov/gists{/gist_id}","starred_url":"https://api.github.com/users/velykov/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/velykov/subscriptions","organizations_url":"https://api.github.com/users/velykov/orgs","repos_url":"https://api.github.com/users/velykov/repos","events_url":"https://api.github.com/users/velykov/events{/privacy}","received_events_url":"https://api.github.com/users/velykov/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":0,"created_at":"2015-10-21T04:06:40Z","updated_at":"2015-10-21T04:06:40Z","closed_at":null,"body":"How can I use a ajax to get values?\r\n\r\nI use angular and code like this:\r\n$scope.types= [];\r\n\r\n    SomeService.getTypes().then(function(resp) {\r\n        var obj = null;\r\n        _.each(resp.data, function(e, i) {\r\n            obj = {};\r\n            obj[e.id] = e.typeName;\r\n            $scope.types.push(obj);\r\n        });\r\n    });\r\n\r\n    $scope.filters = [\r\n        {\r\n            id: 'TYPE_ID',\r\n            label: 'Some label',\r\n            type: 'string',\r\n            input: 'select',\r\n            values: $scope.types, // here is empty array, because ajax is incomplete here\r\n            multiple: true\r\n        },\r\n        ...// many many many filters\r\n    ];\r\n\r\n$scope.loadFilter = function() {\r\n  $FILTER.queryBuilder({\r\n       filters: $scope.filters\r\n   });\r\n};\r\n\r\nI don't want to put loadFilter into ajax readyFunction, because I got many filters, like this (types)."}}