docs(http): fix example usage of MockBackend
This commit is contained in:
		
							parent
							
								
									f2c7946cca
								
							
						
					
					
						commit
						aa8c5aa2e2
					
				| @ -131,7 +131,8 @@ export class MockBackend implements ConnectionBackend { | ||||
|    * ### 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'; | ||||
|    * | ||||
|    * it('should get a response', () => { | ||||
| @ -139,7 +140,7 @@ export class MockBackend implements ConnectionBackend { | ||||
|    *   var text; //this will be set from mock response
 | ||||
|    *   var injector = Injector.resolveAndCreate([ | ||||
|    *     MockBackend, | ||||
|    *     provide(Http, {useFactory: (backend, options) { | ||||
|    *     provide(Http, {useFactory: (backend, options) => { | ||||
|    *       return new Http(backend, options); | ||||
|    *     }, deps: [MockBackend, BaseRequestOptions]}]); | ||||
|    *   var backend = injector.get(MockBackend); | ||||
|  | ||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user