Observables erreurs avec Angular2 bêta.12 et RxJs 5 beta.3

Bonjour,

Je suis en utilisant Angular2 beta 12 cours d'exécution dans VS2015. Quand je l'ai mise à jour rxjs de 5.0.0-bêta.2 à la bêta.3 je rencontre toute une série d'exceptions généralement relatives à mes promesses.

E. g.

  1. Propriété map n'existe pas sur le type de Observable<Response>
  2. Propriété share n'existe pas dans le type Observable<Response>
  3. Ambiante modules déclaration est impossible de spécifier le nom du module par rapport
  4. Ambiante modules ne peuvent pas être imbriqués dans d'autres modules ou les espaces de noms.

Paquet.json

{
  "name": "ASP.NET",
  "version": "0.0.0",
  "scripts": {
    "tsc": "tsc",
    "tsc:w": "tsc -w",
    "lite": "lite-server",
    "start": "concurrent \"npm run tsc:w\" \"npm run lite\" "
  },
  "dependencies": {
    "angular2": "2.0.0-beta.12",
    "systemjs": "0.19.24",
    "es6-promise": "3.1.2",
    "es6-shim": "0.35.0",
    "reflect-metadata": "0.1.3",
    "rxjs": "5.0.0-beta.3", //beta.2 allowed project to build
    "zone.js":"0.6.6"
  },
  "devDependencies": {
    "gulp": "3.9.1",
    "gulp-concat": "2.6.0",
    "gulp-cssmin": "0.1.7",
    "gulp-uglify": "1.5.3",
    "rimraf": "2.2.8",
    "concurrently": "2.0.0",
    "lite-server": "2.1.0",
    "typescript": "1.8.9"
  }
}

Question se rapporte à la carte en fonction de ce code:

import {Injectable} from 'angular2/core';
import {Http, Response} from 'angular2/http';
import {Headers, RequestOptions} from 'angular2/http';
import {Observable}     from 'rxjs/Observable';

import {ApplicationVM} from '../../Applications/ViewModels/Application.ViewModel';

@Injectable()
export class ApplicationService {
    constructor(private http: Http) { }

    private _serviceUrl = './../api/';

    getApplications() {
        return this.http.get(this._serviceUrl + "applications/active")
            .map(res => <ApplicationVM[]>res.json())
           //.map((res: Response) => res.json())
            .do(data => console.log(data)) //eyeball results in the console
            .catch(this.handleError);
    }

    private handleError(error: Response) {
        console.log(error);
        return Observable.throw(error.json().error || 'Server error');
    }

}

Dans un autre, le problème est avec share()

 constructor(private _http: Http) {
     console.log("constructor");
     this.menulist$ = new Observable(observer => this._menulistObserver = observer).share();
     this.menuState$ = new Observable(observer => this._menuStateObserver = observer).share();
     this.menuWidth$ = new Observable(observer => this._menuWidthObserver = observer).share();}

Je crois que ce serait peut-être important - une gamme de rxjs fichiers ont souligné en rouge pour les références relatives ../../Observable (exemple ci-dessous dans l'intervalle.d.ts)

import { IntervalObservable } from '../../observable/IntervalObservable';
declare module '../../Observable' {
    namespace Observable {
        let interval: typeof IntervalObservable.create;
    }
}

Ma botte.ts

///<reference path="./../node_modules/angular2/typings/browser.d.ts"/>
import {bootstrap}      from 'angular2/platform/browser';
import {ROUTER_PROVIDERS} from 'angular2/router';
import {AppComponent} from './app.component';
import {HTTP_PROVIDERS}    from 'angular2/http';
import 'rxjs/Rx'; //kitchen sink

//Bootstrap the application and reference the required directives
bootstrap(AppComponent, [ROUTER_PROVIDERS, HTTP_PROVIDERS]);

Ma page html

 <!-- 1. Load libraries -->
    <script src="~/nodelibs/angular2/bundles/angular2-polyfills.js"></script>
    <script src="~/nodelibs/systemjs/system.src.js"></script>
    <script src="~/nodelibs/typescript/lib/typescript.js"></script>
    <script src="~/nodelibs/rxjs/bundles/Rx.js"></script>
    <script src="~/nodelibs/angular2/bundles/angular2.dev.js"></script>

    <script src="~/nodelibs/angular2/bundles/router.dev.js"></script>
    <script src="~/nodelibs/angular2/bundles/http.dev.js"></script>


    <!-- 2. Configure SystemJS -->
    <script>

    var rootPath = "@Url.Content("~/")";

    System.config({
        //transpiler: 'typescript',
        //typescriptOptions: { emitDecoratorMetadata: true },
        baseURL: rootPath,
        defaultJSExtensions: true,
        packages: {
            app: {
                //format: 'register',
                defaultExtension: 'js'
            }, map: {

                'rxjs/observable/*' : 'nodelibs/rxjs/observable/*.js',
                'rxjs/operators/*' : 'nodelibs/rxjs/operators/*.js',
                'rxjs/*' : 'nodelibs/rxjs/*.js'
            }
        }
    });
    System.import("/app/boot.js")
          .then(null, console.error.bind(console));

    </script>

Je suis perplexe et apprécié de l'aide.

Merci, Dan.

OriginalL'auteur DanAbdn | 2016-03-28