X Tutup
Skip to content

Commit aa8c5aa

Browse files
chrisguttandinalexeagle
authored andcommitted
docs(http): fix example usage of MockBackend
1 parent f2c7946 commit aa8c5aa

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

modules/angular2/src/http/backends/mock_backend.ts

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -131,15 +131,16 @@ export class MockBackend implements ConnectionBackend {
131131
* ### Example
132132
*
133133
* ```
134-
* import {MockBackend, Http, BaseRequestOptions} from 'angular2/http';
134+
* import {Http, BaseRequestOptions} from 'angular2/http';
135+
* import {MockBackend} from 'angular2/http/testing';
135136
* import {Injector} from 'angular2/core';
136137
*
137138
* it('should get a response', () => {
138139
* var connection; //this will be set when a new connection is emitted from the backend.
139140
* var text; //this will be set from mock response
140141
* var injector = Injector.resolveAndCreate([
141142
* MockBackend,
142-
* provide(Http, {useFactory: (backend, options) {
143+
* provide(Http, {useFactory: (backend, options) => {
143144
* return new Http(backend, options);
144145
* }, deps: [MockBackend, BaseRequestOptions]}]);
145146
* var backend = injector.get(MockBackend);

0 commit comments

Comments
 (0)
X Tutup