I'm trying to get the value from a simple ajax request, but I don't understand how to do that. Here is the code:
Rx.Observable
.ajax({ url: 'https://jsonplaceholder.typicode.com/posts', method: 'GET', responseType: 'json' })
.subscribe(function(data) { return data.response; });
I searched everywhere and there is no simple explanation.
Thanks!
Observable.ajax
can acceptstring
orObject
with the following interface:And here is examples: