Nicholas Jamieson
1 min readFeb 20, 2018

--

There’s no index in the observable/dom directory, so my imports should have been:

import { ajax } from "rxjs/observable/dom/ajax";
import { AjaxResponse } from "rxjs/observable/dom/AjaxObservable";

I’ve updated the embedded gist.

Angular’s HttpClient returns an observable, so you can use it instead, but you’ll need to specify { observe: "response" } — as you’ll need the response’s headers.

There's nothing special about RxJS's ajax observable. I used it because it's simple and framework-independent.

--

--

Nicholas Jamieson
Nicholas Jamieson

Written by Nicholas Jamieson

RxJS core team member; front-end developer; mentor; speaker; open-source contributor

No responses yet