docs(http): fix example usage of MockBackend

This commit is contained in:
Christoph Guttandin 2016-01-12 13:24:03 +01:00 committed by Alex Eagle
parent f2c7946cca
commit aa8c5aa2e2
1 changed files with 3 additions and 2 deletions

View File

@ -131,7 +131,8 @@ export class MockBackend implements ConnectionBackend {
* ### Example * ### Example
* *
* ``` * ```
* import {MockBackend, Http, BaseRequestOptions} from 'angular2/http'; * import {Http, BaseRequestOptions} from 'angular2/http';
* import {MockBackend} from 'angular2/http/testing';
* import {Injector} from 'angular2/core'; * import {Injector} from 'angular2/core';
* *
* it('should get a response', () => { * it('should get a response', () => {
@ -139,7 +140,7 @@ export class MockBackend implements ConnectionBackend {
* var text; //this will be set from mock response * var text; //this will be set from mock response
* var injector = Injector.resolveAndCreate([ * var injector = Injector.resolveAndCreate([
* MockBackend, * MockBackend,
* provide(Http, {useFactory: (backend, options) { * provide(Http, {useFactory: (backend, options) => {
* return new Http(backend, options); * return new Http(backend, options);
* }, deps: [MockBackend, BaseRequestOptions]}]); * }, deps: [MockBackend, BaseRequestOptions]}]);
* var backend = injector.get(MockBackend); * var backend = injector.get(MockBackend);