docs(http): Added base request options for test example
This commit is contained in:
parent
3529ee9973
commit
4e43d6f769
|
@ -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
|
||||||
|
|
Loading…
Reference in New Issue