X Tutup
Skip to content

Commit f1796d6

Browse files
committed
feat(facade): add .values to StringMapWrapper
1 parent cb38d72 commit f1796d6

File tree

2 files changed

+10
-0
lines changed

2 files changed

+10
-0
lines changed

modules/angular2/src/facade/collection.dart

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,10 @@ class StringMapWrapper {
8585
return a.keys.toList();
8686
}
8787

88+
static List values(Map<String, dynamic> a) {
89+
return a.values.toList();
90+
}
91+
8892
static bool isEmpty(Map m) => m.isEmpty;
8993
static bool equals/*<V>*/(Map/*<String,V>*/ m1, Map/*<String,V>*/ m2) {
9094
if (m1.length != m2.length) {

modules/angular2/src/facade/collection.ts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,12 @@ export class StringMapWrapper {
116116
}
117117
static set<V>(map: {[key: string]: V}, key: string, value: V) { map[key] = value; }
118118
static keys(map: {[key: string]: any}): string[] { return Object.keys(map); }
119+
static values<T>(map: {[key: string]: T}): T[] {
120+
return Object.keys(map).reduce((r, a) => {
121+
r.push(map[a]);
122+
return r;
123+
}, []);
124+
}
119125
static isEmpty(map: {[key: string]: any}): boolean {
120126
for (var prop in map) {
121127
return false;

0 commit comments

Comments
 (0)
X Tutup