File tree Expand file tree Collapse file tree 2 files changed +13
-0
lines changed
modules/angular2/src/facade Expand file tree Collapse file tree 2 files changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -232,6 +232,14 @@ class ListWrapper {
232232 static bool isImmutable (List l) {
233233 return l is UnmodifiableListView ;
234234 }
235+
236+ static List flatten (List l) {
237+ final res = [];
238+ l.forEach ((item) {
239+ res.addAll (item);
240+ });
241+ return res;
242+ }
235243}
236244
237245bool isListLikeIterable (obj) => obj is Iterable ;
Original file line number Diff line number Diff line change @@ -278,6 +278,11 @@ export class ListWrapper {
278278 }
279279
280280 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+ return res ;
285+ }
281286}
282287
283288export function isListLikeIterable ( obj : any ) : boolean {
You can’t perform that action at this time.
0 commit comments