I am trying to return an Observable from a service with mock data.
I am returning this from my service :
return Observable.of(new Object()).map(MOCKACCOUNT =>JSON.stringify(MOCKACCOUNT));
I get an error
Observable_1.Observable.of is not a function.
Am I missing some include? I am importing
import {Observable} from "rxjs/Observable";
Note: I was returning a mock promise prior but based on my understanding I would not be able to interpolate the value. For example {{returnFromServiceStoredInExportedClass.name}}
Looks like
import {Observable} from "rxjs/Observable";
should be
import {Observable} from "rxjs/Rx";
See also Angular2 RxJS getting 'Observable_1.Observable.fromEvent is not a function' error
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With