Rx.DOM.Request.getJSON(url)

# [Ⓣ][1]

Creates an observable sequence from JSON from an Ajax request.

Arguments

  1. url (String): A string of the URL to make the Ajax call.

Returns

(Observable): The observable sequence which contains the parsed JSON.

Example

Rx.DOM.Request.get('/products')
    .subscribe(
        function (data) {
            // Log data length
            console.log(data.length);
        },
        function (err) {
            // Log the error
        }
    );