getjson.md
October 9, 2015 · View on GitHub
Rx.DOM.getJSON(url)
Creates an observable sequence from JSON from an Ajax request. This is just a shortcut to the Rx.DOM.ajax method with the GET method and parsing the responseText as JSON.
Arguments
url(String): A string of the URL to make the Ajax call.
Returns
(Observable): The observable sequence which contains the parsed JSON.
Example
Rx.getJSON('/products')
.subscribe(
function (data) {
// Log data length
console.log(data.length);
},
function (err) {
// Log the error
}
);
Location
File:
Dist:
Prerequisites:
- If using
rx.js rx.lite.js|rx.lite.compat.js
NPM Packages:
NuGet Packages:
Unit Tests: