Observable.of is not a function
Actually I have imports messed up. In latest version of RxJS we can import it like that:
import 'rxjs/add/observable/of';
If anybody is having this problem while using Angular >= 6 and rxjs version 6 or greater, see the answers here: Could not use Observable.of in RxJs 6 and Angular 6
In short, you need to import it like this:
import { of } from 'rxjs';
And then instead of calling
Observable.of(res);
just use
of(res);