fix(common): document HttpClient, fixing a few other issues

This commit is contained in:
Alex Rickabaugh
2017-07-12 17:00:23 -07:00
committed by Igor Minar
parent ce0f4f0d7c
commit 18559897a0
6 changed files with 1178 additions and 310 deletions

View File

@ -38,10 +38,10 @@ export class HttpClientTestingBackend implements HttpBackend, HttpTestingControl
* Handle an incoming request by queueing it in the list of open requests.
*/
handle(req: HttpRequest<any>): Observable<HttpEvent<any>> {
return new Observable((observer: Observer<HttpEvent<any>>) => {
return new Observable((observer: Observer<any>) => {
const testReq = new TestRequest(req, observer);
this.open.push(testReq);
observer.next({type: HttpEventType.Sent});
observer.next({ type: HttpEventType.Sent } as HttpEvent<any>);
return () => { testReq._cancelled = true; };
});
}