You do not need to import {of} from 'rxjs/add/observable/of' . You can directly use
import { Observable } from "rxjs/Observable"; import "rxjs/add/observable/of";
Or you can import an Observable from "rxjs / Rx", which binds all operators. Bad practice
import { Observable } from "rxjs/Rx";
Update 2018-01-26: RxJS v5.5 + operators with protocol
From https://github.com/ReactiveX/rxjs/blob/master/doc/pipeable-operators.md
Starting with version 5.5, we sent "tubular operators" that can be accessed in rxjs / operators (note the pluralized "operators"). They are designed to provide a better approach for attracting only the operators you need than the patch operators found in rxjs / add / operator / *.
Now that the import “fix” is deprecated, it would be better to use strict import.
import { of as observableOf } from 'rxjs/observable/of'
and use it that way
const myObs$: Observable<number> = observableOf(1, 2, 3)
source share