mercredi 13 décembre 2017

response undefined when calling google api thru emberjs

I am trying to call google api for getting place suggestions from ember js. like below: this is the service module

fetch(){
let url=`http://ift.tt/2yqGGB3
return Ember.RSVP.resolve(Ember.$ajax(url,{
method: 'GET'
}))
.then(
(response)=>{
console.log("google suggested places:",response);
return response;
})

*the above url when served with API_KEY and pasted in browser, a JSON response is returned with the suggested places.

also, i am seeing JSON response in newtwork tab of developer tools but the .then is not able to capture that resonse, and printing in console as response undefined.

ref : http://ift.tt/2AGMOuY

What am i doing wrong?




Aucun commentaire:

Enregistrer un commentaire