|
1 | 1 | import {ConnectionBackend, Connection} from '../interfaces'; |
2 | | -import {ReadyStates, RequestMethods, RequestMethodsMap, ResponseTypes} from '../enums'; |
| 2 | +import {ReadyStates, RequestMethods, ResponseTypes} from '../enums'; |
3 | 3 | import {Request} from '../static_request'; |
4 | 4 | import {Response} from '../static_response'; |
5 | 5 | import {ResponseOptions, BaseResponseOptions} from '../base_response_options'; |
@@ -27,14 +27,11 @@ export class XHRConnection implements Connection { |
27 | 27 | private _xhr; // TODO: make type XMLHttpRequest, pending resolution of |
28 | 28 | // https://github.com/angular/ts2dart/issues/230 |
29 | 29 | constructor(req: Request, browserXHR: BrowserXhr, baseResponseOptions?: ResponseOptions) { |
30 | | - // TODO: get rid of this when enum lookups are available in ts2dart |
31 | | - // https://github.com/angular/ts2dart/issues/221 |
32 | | - var requestMethodsMap = new RequestMethodsMap(); |
33 | 30 | this.request = req; |
34 | 31 | this.response = new EventEmitter(); |
35 | 32 | this._xhr = browserXHR.build(); |
36 | 33 | // TODO(jeffbcross): implement error listening/propagation |
37 | | - this._xhr.open(requestMethodsMap.getMethod(ENUM_INDEX(req.method)), req.url); |
| 34 | + this._xhr.open(RequestMethods[ENUM_INDEX(req.method)], req.url); |
38 | 35 | this._xhr.addEventListener('load', (_) => { |
39 | 36 | // responseText is the old-school way of retrieving response (supported by IE8 & 9) |
40 | 37 | // response/responseType properties were introduced in XHR Level2 spec (supported by IE10) |
|
0 commit comments