Property ‘of’ does not exist on type ‘typeof Observable [duplicate]

You need to import it:

for Angular >= 6.0.0

uses RxJS 6.0.0 Angular Changelog 6.0.0

import { of } from 'rxjs';

And its usage has been changed, you no longer call it off of Observable:

of('token');

RxJS v5.x to v6 Update Guide – HowTo: Convert to pipe syntax which uses of()

for Angular <= 5.x.xx

import 'rxjs/add/observable/of';

And it’s used as you have in your question

Observable.of('token');

Leave a Comment