docs(http): Added base request options for test example

This commit is contained in:
Brandon Roberts 2015-12-20 20:28:52 -06:00 committed by Alex Eagle
parent 3529ee9973
commit 4e43d6f769
1 changed files with 4 additions and 4 deletions

View File

@ -98,15 +98,15 @@ export class MockConnection implements Connection {
* ### Example * ### Example
* *
* ``` * ```
* import {DefaultOptions, Http} from 'angular2/http'; * import {BaseRequestOptions, Http} from 'angular2/http';
* import {MockBackend} from 'angular2/http/testing'; * import {MockBackend} from 'angular2/http/testing';
* it('should get some data', inject([AsyncTestCompleter], (async) => { * it('should get some data', inject([AsyncTestCompleter], (async) => {
* var connection; * var connection;
* var injector = Injector.resolveAndCreate([ * var injector = Injector.resolveAndCreate([
* MockBackend, * MockBackend,
* provide(Http, {useFactory: (backend, defaultOptions) => { * provide(Http, {useFactory: (backend, options) => {
* return new Http(backend, defaultOptions) * return new Http(backend, options);
* }, deps: [MockBackend, DefaultOptions]})]); * }, deps: [MockBackend, BaseRequestOptions]})]);
* var http = injector.get(Http); * var http = injector.get(Http);
* var backend = injector.get(MockBackend); * var backend = injector.get(MockBackend);
* //Assign any newly-created connection to local variable * //Assign any newly-created connection to local variable