diff --git a/modules/angular2/src/facade/async.ts b/modules/angular2/src/facade/async.ts index d02945d7fd..be10aa075d 100644 --- a/modules/angular2/src/facade/async.ts +++ b/modules/angular2/src/facade/async.ts @@ -3,9 +3,13 @@ import {global, isPresent, noop} from 'angular2/src/facade/lang'; // without depending on rxjs. import {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise'; export {PromiseWrapper, Promise, PromiseCompleter} from 'angular2/src/facade/promise'; -import {Subject, Subscription, Observable as RxObservable} from '@reactivex/rxjs/dist/cjs/Rx'; -export {Subject} from '@reactivex/rxjs/dist/cjs/Rx'; -import Operator from '@reactivex/rxjs/dist/cjs/Operator'; + +import {Subject} from '@reactivex/rxjs/dist/cjs/Subject'; +import {Observable as RxObservable} from '@reactivex/rxjs/dist/cjs/Observable'; +import {Subscription} from '@reactivex/rxjs/dist/cjs/Subscription'; +import {Operator} from '@reactivex/rxjs/dist/cjs/Operator'; +export {Subject} from '@reactivex/rxjs/dist/cjs/Subject'; + export namespace NodeJS { export interface Timer {} diff --git a/modules/angular2/test/core/facade/observable_spec.dart b/modules/angular2/test/core/facade/observable_spec.dart new file mode 100644 index 0000000000..4877b20756 --- /dev/null +++ b/modules/angular2/test/core/facade/observable_spec.dart @@ -0,0 +1,5 @@ +library angular2.test.facade.observable_spec; + +main() { + //stub to ignore JS Observable specific tests +} diff --git a/modules/angular2/test/core/facade/observable_spec.ts b/modules/angular2/test/core/facade/observable_spec.ts new file mode 100644 index 0000000000..ae51a1b204 --- /dev/null +++ b/modules/angular2/test/core/facade/observable_spec.ts @@ -0,0 +1,63 @@ +import { + describe, + it, + expect, + beforeEach, + ddescribe, + iit, + xit, + el, + SpyObject, + AsyncTestCompleter, + inject +} from 'angular2/testing_internal'; + +import {Observable, Subject, EventEmitter, PromiseWrapper} from 'angular2/src/facade/async'; + +export function main() { + describe("Observable", () => { + describe("#core", () => { + + it("should call next with values", inject([AsyncTestCompleter], (async) => { + + let o = new Observable(sink => { sink.next(1); }); + + o.subscribe(v => { + expect(v).toEqual(1); + async.done(); + }); + + })); + + it("should call next and then complete", inject([AsyncTestCompleter], (async) => { + + let o = new Observable(sink => { + sink.next(1); + sink.complete(); + }); + let nexted = false; + + o.subscribe(v => { nexted = true; }, null, () => { + expect(nexted).toBe(true); + async.done(); + }); + + })); + + it("should call error with errors", inject([AsyncTestCompleter], (async) => { + + let o = new Observable(sink => { sink.error('oh noes!'); }); + + o.subscribe( + v => { + + }, + (err) => { + expect(err).toEqual('oh noes!'); + async.done(); + }); + + })); + }); + }); +} diff --git a/modules/angular2/test/public_api_spec.ts b/modules/angular2/test/public_api_spec.ts index 966154e863..3163681a9f 100644 --- a/modules/angular2/test/public_api_spec.ts +++ b/modules/angular2/test/public_api_spec.ts @@ -686,51 +686,9 @@ var NG_ALL = [ /* RxJS API - may need to maintain as RxJS evolves */ - 'EventEmitter.mapTo():js', - 'EventEmitter.next():js', 'EventEmitter.emit():js', - 'EventEmitter.materialize():js', - 'EventEmitter.merge():js', - 'EventEmitter.mergeAll():js', - 'EventEmitter.mergeMap():js', - 'EventEmitter.mergeMapTo():js', - 'EventEmitter.multicast():js', - 'EventEmitter.observeOn():js', - 'EventEmitter.remove():js', - 'EventEmitter.repeat():js', - 'EventEmitter.retry():js', - 'EventEmitter.retryWhen():js', - 'EventEmitter.throttle():js', - 'EventEmitter.toPromise():js', - 'EventEmitter.window():js', - 'EventEmitter.windowCount():js', - 'EventEmitter.windowTime():js', - 'EventEmitter.windowToggle():js', - 'EventEmitter.windowWhen():js', - 'EventEmitter.withLatestFrom():js', - 'EventEmitter.zip():js', - 'EventEmitter.zipAll():js', - 'Observable:js', - 'Observable#combineLatest():js', - 'Observable#concat():js', 'Observable#create():js', - 'Observable#defer():js', - 'Observable#empty():js', - 'Observable#forkJoin():js', - 'Observable#from():js', - 'Observable#fromArray():js', - 'Observable#fromEvent():js', - 'Observable#fromEventPattern():js', - 'Observable#fromPromise():js', - 'Observable#interval():js', - 'Observable#merge():js', - 'Observable#never():js', - 'Observable#of():js', - 'Observable#range():js', - 'Observable#throw():js', - 'Observable#timer():js', - 'Observable#zip():js', 'Observable.buffer():js', 'Observable.bufferCount():js', 'Observable.bufferTime():js', diff --git a/modules/playground/src/http/http_comp.ts b/modules/playground/src/http/http_comp.ts index ccad58c110..914a19be42 100644 --- a/modules/playground/src/http/http_comp.ts +++ b/modules/playground/src/http/http_comp.ts @@ -16,8 +16,6 @@ import {Http, Response} from 'angular2/http'; export class HttpCmp { people: Object[]; constructor(http: Http) { - http.get('./people.json') - .map((res: Response) => res.json()) - .subscribe((people: Array) => this.people = people); + http.get('./people.json').subscribe(res => { this.people = res.json(); }); } } diff --git a/npm-shrinkwrap.clean.json b/npm-shrinkwrap.clean.json index ba60b155b0..38819c5aca 100644 --- a/npm-shrinkwrap.clean.json +++ b/npm-shrinkwrap.clean.json @@ -1,7 +1,7 @@ { "dependencies": { "@reactivex/rxjs": { - "version": "5.0.0-alpha.7" + "version": "5.0.0-alpha.10" }, "angular": { "version": "1.4.7" diff --git a/npm-shrinkwrap.json b/npm-shrinkwrap.json index 7a0feff288..9dca270d6a 100644 --- a/npm-shrinkwrap.json +++ b/npm-shrinkwrap.json @@ -3,9 +3,9 @@ "version": "2.0.0-alpha.46", "dependencies": { "@reactivex/rxjs": { - "version": "5.0.0-alpha.7", - "from": "https://registry.npmjs.org/@reactivex/rxjs/-/rxjs-5.0.0-alpha.7.tgz", - "resolved": "https://registry.npmjs.org/@reactivex/rxjs/-/rxjs-5.0.0-alpha.7.tgz" + "version": "5.0.0-alpha.10", + "from": "@reactivex/rxjs@5.0.0-alpha.10", + "resolved": "http://registry.npmjs.org/@reactivex/rxjs/-/rxjs-5.0.0-alpha.10.tgz" }, "angular": { "version": "1.4.7", diff --git a/package.json b/package.json index b11dae3462..b12b5083e1 100644 --- a/package.json +++ b/package.json @@ -31,7 +31,7 @@ "test": "gulp test.all.js && gulp test.all.dart" }, "dependencies": { - "@reactivex/rxjs": "5.0.0-alpha.7", + "@reactivex/rxjs": "5.0.0-alpha.10", "reflect-metadata": "0.1.2", "zone.js": "0.5.8" }, diff --git a/tools/broccoli/html-replace/SCRIPTS.html b/tools/broccoli/html-replace/SCRIPTS.html index 296b260221..3572d85c57 100644 --- a/tools/broccoli/html-replace/SCRIPTS.html +++ b/tools/broccoli/html-replace/SCRIPTS.html @@ -12,6 +12,7 @@ 'angular2/src/testing/benchmark_util': {defaultExtension: 'js'}, 'angular2/src/facade/browser': {defaultExtension: 'js'}, 'angular2/bootstrap': {defaultExtension: 'js'}, + 'rxjs': {defaultExtension: 'js'}, } }); diff --git a/tools/broccoli/html-replace/SCRIPTS_benchmarks.html b/tools/broccoli/html-replace/SCRIPTS_benchmarks.html index a62d620412..163d331055 100644 --- a/tools/broccoli/html-replace/SCRIPTS_benchmarks.html +++ b/tools/broccoli/html-replace/SCRIPTS_benchmarks.html @@ -13,6 +13,7 @@ 'angular2/src/testing/benchmark_util': {defaultExtension: 'js'}, 'angular2/src/facade/browser': {defaultExtension: 'js'}, 'angular2/bootstrap': {defaultExtension: 'js'}, + 'rxjs': {defaultExtension: 'js'}, } });