using rxjs beta2 my project works great, but updating to beta6 I get a long list of compile error:
component.ts(34,18): error TS2339: Property 'finally' does not exist on type 'Observable<T[]>'.
....
....
.component.ts(51,10): error TS2339: Property 'switchMap' does not exist on type 'Observable<Company>'.
....
....
service.ts(24,18): error TS2339: Property 'map' does not exist on type 'Observable<Response>'
....
....
node_modules/rxjs/add/observable/range.d.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules.
node_modules/rxjs/add/observable/range.d.ts(2,16): error TS2436: Ambient module declaration cannot specify relative module name.
node_modules/rxjs/add/operator/catch.d.ts(2,16): error TS2435: Ambient modules cannot be nested in other modules.
node_modules/rxjs/add/operator/catch.d.ts(2,16): error TS2436: Ambient module declaration cannot specify relative m
..
I'm importing Observables like this:
import {Observable} from 'rxjs/Observable';
What am I doing wrong?
Thanks a lot
EDIT using rc1 rxjs beta6 works. But I had to cast the result on all my observables. Before I could use:
this._couseSourcesSvc.readAll ()
.finally (() => sourcesSpinner.hide ())
.subscribe (
res => {
this.sources = res;
}
But now I have to use:
this._couseSourcesSvc.readAll ()
.finally (() => sourcesSpinner.hide ())
.subscribe (
(res:Sources[]) => {
this.sources = res;
}
As you can see I have to cast the result or I get a compile error (res:Sources[])
Type '{}' is not assignable to type 'DocumentSource[]'.
Is this normal?
Only Angular2 rc.0 (which came out just last night) supports rx beta 6.
Upgrade your angular to release candidate 1 to be able to update RxJs.
Note you'll have to update your imports to
@angular/core|@angular/httpetc. The name has changed fromangular2/*
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