Currently, I am successfully using a d3.queue() object to fetch json data from an api endpoint:
d3.queue().defer(d3.json, "http://myurl.com/myendpoint")
(I'm working with Angular) However, I want to change things up and use my Angular service to make the call to that endpoint instead.
(Endpoint code:)
getSAData: function(myUrl){
return $http.get(fullUrl)
.success(function(data) {
return data;
})
.error(function(data){
console.log('Error retrieving data');
})
}
I haven't come across any examples of this, but when I tried the following:
d3.queue().defer(ApiService.getMyData("http://myurl.com/myendpoint"))
I encountered the error message:
Uncaught Error
at Vt.defer (eval at globalEval (jquery-2.1.4.min.js:2), <anonymous>:6:28622)