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.