It is good to know that I am not doing something totally stupid. But I am still getting a syntax error. I set a breakpoint inside the first 'then' function and it never gets there. The chrome debugger seems to point to the angular callback (something like angular_callback_0).
On Friday, March 4, 2016, Sander Elias <[email protected]> wrote: > Hi Kevin, > > Yep, that is how it works. The $http.jsonp request does all the hard work > for you, and you get a nice JSON object out of it. Please note that the > object you are getting is the complete response, including a lot of meta > data. Do I guess it right that you are feeding this right into > JSON.parse()? That would explain the error you are seeing. > If you are interested in just the data, you should do something like this: > > $http > .jsonp("http://localhost:28017/...?format=jsonp&callback=JSON_CALLBACK"). > .then(function (response) {return response.data}) > .then(function (data) { > console.log('resulting object:', data); > }} > > Or do you have another problem? > > Regards > Sander > > > -- > You received this message because you are subscribed to a topic in the > Google Groups "AngularJS" group. > To unsubscribe from this topic, visit > https://groups.google.com/d/topic/angular/QQzwdLTl2AA/unsubscribe. > To unsubscribe from this group and all its topics, send an email to > [email protected] > <javascript:_e(%7B%7D,'cvml','angular%[email protected]');>. > To post to this group, send email to [email protected] > <javascript:_e(%7B%7D,'cvml','[email protected]');>. > Visit this group at https://groups.google.com/group/angular. > For more options, visit https://groups.google.com/d/optout. > -- You received this message because you are subscribed to the Google Groups "AngularJS" group. To unsubscribe from this group and stop receiving emails from it, send an email to [email protected]. To post to this group, send email to [email protected]. Visit this group at https://groups.google.com/group/angular. For more options, visit https://groups.google.com/d/optout.
