fix(types): Add StringMap type
This commit is contained in:
@ -1,6 +1,6 @@
|
||||
import {isBlank, isPresent, BaseException, stringify} from 'angular2/src/facade/lang';
|
||||
import {DOM, Element} from 'angular2/src/facade/dom';
|
||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {StringMapWrapper, StringMap} from 'angular2/src/facade/collection';
|
||||
|
||||
import {XHR} from './xhr/xhr';
|
||||
|
||||
@ -11,7 +11,7 @@ import {Template} from 'angular2/src/core/annotations/template';
|
||||
*/
|
||||
export class TemplateLoader {
|
||||
_xhr: XHR;
|
||||
_cache;
|
||||
_cache: StringMap;
|
||||
|
||||
constructor(xhr: XHR) {
|
||||
this._xhr = xhr;
|
||||
|
@ -57,7 +57,6 @@ class MapWrapper {
|
||||
static Iterable values(Map m) => m.values;
|
||||
}
|
||||
|
||||
// TODO: how to export StringMap=Map as a type?
|
||||
class StringMapWrapper {
|
||||
static HashMap create() => new HashMap();
|
||||
static bool contains(Map map, key) => map.containsKey(key);
|
||||
|
@ -3,6 +3,7 @@ import {int, isJsObject, global} from 'angular2/src/facade/lang';
|
||||
export var List = global.Array;
|
||||
export var Map = global.Map;
|
||||
export var Set = global.Set;
|
||||
export var StringMap = global.Object;
|
||||
|
||||
export class MapWrapper {
|
||||
static create():Map { return new Map(); }
|
||||
@ -29,7 +30,6 @@ export class MapWrapper {
|
||||
static values(m) { return m.values(); }
|
||||
}
|
||||
|
||||
// TODO: cannot export StringMap as a type as Dart does not support renaming types...
|
||||
/**
|
||||
* Wraps Javascript Objects
|
||||
*/
|
||||
|
6
modules/angular2/src/forms/model.js
vendored
6
modules/angular2/src/forms/model.js
vendored
@ -1,4 +1,4 @@
|
||||
import {StringMapWrapper} from 'angular2/src/facade/collection';
|
||||
import {StringMapWrapper, StringMap} from 'angular2/src/facade/collection';
|
||||
|
||||
export class Control {
|
||||
value:any;
|
||||
@ -9,9 +9,9 @@ export class Control {
|
||||
}
|
||||
|
||||
export class ControlGroup {
|
||||
controls;
|
||||
controls: StringMap;
|
||||
|
||||
constructor(controls) {
|
||||
constructor(controls:StringMap) {
|
||||
this.controls = controls;
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user