Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(http) remove .toRx() from http calls #4578

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 2 additions & 2 deletions modules/angular2/http.ts
Expand Up @@ -69,7 +69,7 @@ export {URLSearchParams} from './src/http/url_search_params';
* export class App {
* people: Object[];
* constructor(http:Http) {
* http.get('people.json').toRx().subscribe(res => {
* http.get('people.json').subscribe(res => {
* this.people = res.json();
* });
* }
Expand Down Expand Up @@ -195,7 +195,7 @@ export const HTTP_BINDINGS: any[] = [
* export class App {
* people: Array<Object>;
* constructor(jsonp:Jsonp) {
* jsonp.request('people.json').toRx().subscribe(res => {
* jsonp.request('people.json').subscribe(res => {
* this.people = res.json();
* })
* }
Expand Down
12 changes: 6 additions & 6 deletions modules/angular2/src/http/backends/mock_backend.ts
Expand Up @@ -47,8 +47,8 @@ export class MockConnection implements Connection {
*
* ```
* var connection;
* backend.connections.toRx().subscribe(c => connection = c);
* http.request('data.json').toRx().subscribe(res => console.log(res.text()));
* backend.connections.subscribe(c => connection = c);
* http.request('data.json').subscribe(res => console.log(res.text()));
* connection.mockRespond(new Response('fake response')); //logs 'fake response'
* ```
*
Expand Down Expand Up @@ -108,8 +108,8 @@ export class MockConnection implements Connection {
* var http = injector.get(Http);
* var backend = injector.get(MockBackend);
* //Assign any newly-created connection to local variable
* backend.connections.toRx().subscribe(c => connection = c);
* http.request('data.json').toRx().subscribe((res) => {
* backend.connections.subscribe(c => connection = c);
* http.request('data.json').subscribe((res) => {
* expect(res.text()).toBe('awesome');
* async.done();
* });
Expand Down Expand Up @@ -142,8 +142,8 @@ export class MockBackend implements ConnectionBackend {
* }, [MockBackend, BaseRequestOptions]]);
* var backend = injector.get(MockBackend);
* var http = injector.get(Http);
* backend.connections.toRx().subscribe(c => connection = c);
* http.request('something.json').toRx().subscribe(res => {
* backend.connections.subscribe(c => connection = c);
* http.request('something.json').subscribe(res => {
* text = res.text();
* });
* connection.mockRespond(new Response({body: 'Something'}));
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/http/backends/xhr_backend.ts
Expand Up @@ -101,7 +101,7 @@ export class XHRConnection implements Connection {
* })
* class MyComponent {
* constructor(http:Http) {
* http('people.json').toRx().subscribe(res => this.people = res.json());
* http('people.json').subscribe(res => this.people = res.json());
* }
* }
* ```
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/http/static_request.ts
Expand Up @@ -42,7 +42,7 @@ import {
*
* var injector = Injector.resolveAndCreate([HTTP_BINDINGS, AutoAuthenticator]);
* var authenticator = injector.get(AutoAuthenticator);
* authenticator.request('people.json').toRx().subscribe(res => {
* authenticator.request('people.json').subscribe(res => {
* //URL should have included '?password=123'
* console.log('people', res.json());
* });
Expand Down
2 changes: 1 addition & 1 deletion modules/angular2/src/http/static_response.ts
Expand Up @@ -15,7 +15,7 @@ import {isJsObject} from './http_utils';
* #Example
*
* ```
* http.request('my-friends.txt').toRx().subscribe(response => this.friends = response.text());
* http.request('my-friends.txt').subscribe(response => this.friends = response.text());
* ```
*
* The Response's interface is inspired by the Response constructor defined in the [Fetch
Expand Down