Observable.of is not a function

uksz picture uksz · Apr 12, 2016 · Viewed 146.2k times · Source

I am having issue with importing Observable.of function in my project. My Intellij sees everything. In my code I have:

import {Observable} from 'rxjs/Observable';

and in my code I use it like that:

return Observable.of(res);

Any ideas?

Answer

uksz picture uksz · Apr 12, 2016

Actually I have imports messed up. In latest version of RxJS we can import it like that:

import 'rxjs/add/observable/of';