feat(http): refactor library to work in dart

Mostly internal refactoring needed to make ts2dart and DartAnalyzer happy.

Fixes #2415
This commit is contained in:
Jeff Cross
2015-06-19 12:14:12 -07:00
parent fa7da0ca5d
commit 55bf0e554f
26 changed files with 424 additions and 379 deletions

View File

@ -1,3 +1,5 @@
import {StringMap, StringMapWrapper} from 'angular2/src/facade/collection';
export enum RequestModesOpts {
Cors,
NoCors,
@ -29,6 +31,14 @@ export enum RequestMethods {
PATCH
}
// TODO: Remove this when enum lookups are available in ts2dart
// https://github.com/angular/ts2dart/issues/221
export class RequestMethodsMap {
private _methods: List<string>;
constructor() { this._methods = ['GET', 'POST', 'PUT', 'DELETE', 'OPTIONS', 'HEAD', 'PATCH']; }
getMethod(method: int): string { return this._methods[method]; }
}
export enum ReadyStates {
UNSENT,
OPEN,