diff --git a/modules/angular2/src/facade/collection.dart b/modules/angular2/src/facade/collection.dart index 8e7277f60b..b903e584f2 100644 --- a/modules/angular2/src/facade/collection.dart +++ b/modules/angular2/src/facade/collection.dart @@ -85,6 +85,10 @@ class StringMapWrapper { return a.keys.toList(); } + static List values(Map a) { + return a.values.toList(); + } + static bool isEmpty(Map m) => m.isEmpty; static bool equals/**/(Map/**/ m1, Map/**/ m2) { if (m1.length != m2.length) { diff --git a/modules/angular2/src/facade/collection.ts b/modules/angular2/src/facade/collection.ts index f4c3f2752a..ef6587492c 100644 --- a/modules/angular2/src/facade/collection.ts +++ b/modules/angular2/src/facade/collection.ts @@ -116,6 +116,12 @@ export class StringMapWrapper { } static set(map: {[key: string]: V}, key: string, value: V) { map[key] = value; } static keys(map: {[key: string]: any}): string[] { return Object.keys(map); } + static values(map: {[key: string]: T}): T[] { + return Object.keys(map).reduce((r, a) => { + r.push(map[a]); + return r; + }, []); + } static isEmpty(map: {[key: string]: any}): boolean { for (var prop in map) { return false;