docs(http): fix http documentation

Closes #3931
This commit is contained in:
Tamas Csaba
2015-09-01 09:55:37 +02:00
committed by Misko Hevery
parent 9b009b3159
commit e34a29dafe
4 changed files with 9 additions and 9 deletions

View File

@ -55,8 +55,8 @@ export class MockConnection implements Connection {
*
* ```
* var connection;
* backend.connections.subscribe(c => connection = c);
* http.request('data.json').subscribe(res => console.log(res.text()));
* backend.connections.toRx().subscribe(c => connection = c);
* http.request('data.json').toRx().subscribe(res => console.log(res.text()));
* connection.mockRespond(new Response('fake response')); //logs 'fake response'
* ```
*
@ -117,8 +117,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.subscribe(c => connection = c);
* http.request('data.json').subscribe((res) => {
* backend.connections.toRx().subscribe(c => connection = c);
* http.request('data.json').toRx().subscribe((res) => {
* expect(res.text()).toBe('awesome');
* async.done();
* });
@ -151,8 +151,8 @@ export class MockBackend implements ConnectionBackend {
* }, [MockBackend, BaseRequestOptions]]);
* var backend = injector.get(MockBackend);
* var http = injector.get(Http);
* backend.connections.subscribe(c => connection = c);
* http.request('something.json').subscribe(res => {
* backend.connections.toRx().subscribe(c => connection = c);
* http.request('something.json').toRx().subscribe(res => {
* text = res.text();
* });
* connection.mockRespond(new Response({body: 'Something'}));