We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent 91999e0 commit a1880c3Copy full SHA for a1880c3
2 files changed
modules/angular2/src/facade/collection.dart
@@ -232,6 +232,14 @@ class ListWrapper {
232
static bool isImmutable(List l) {
233
return l is UnmodifiableListView;
234
}
235
+
236
+ static List flatten(List l) {
237
+ final res = [];
238
+ l.forEach((item) {
239
+ res.addAll(item);
240
+ });
241
+ return res;
242
+ }
243
244
245
bool isListLikeIterable(obj) => obj is Iterable;
modules/angular2/src/facade/collection.ts
@@ -278,6 +278,11 @@ export class ListWrapper {
278
279
280
static isImmutable(list: any[]): boolean { return Object.isSealed(list); }
281
+ static flatten<T>(array: T[][]): T[] {
282
+ let res = [];
283
+ array.forEach((a) => res = res.concat(a));
284
285
286
287
288
export function isListLikeIterable(obj: any): boolean {
0 commit comments