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.

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

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store