feat(ElementInjector): implement ElementInjector
This commit is contained in:
@ -22,6 +22,8 @@ class ListWrapper {
|
||||
static void set(m, k, v) { m[k] = v; }
|
||||
static contains(m, k) => m.containsKey(k);
|
||||
static map(list, fn) => list.map(fn).toList();
|
||||
static find(List list, fn) => list.firstWhere(fn, orElse:() => null);
|
||||
static any(List list, fn) => list.any(fn);
|
||||
static forEach(list, fn) {
|
||||
list.forEach(fn);
|
||||
}
|
||||
|
@ -41,6 +41,18 @@ export class ListWrapper {
|
||||
if (!array || array.length == 0) return null;
|
||||
return array[array.length - 1];
|
||||
}
|
||||
static find(list:List, pred:Function) {
|
||||
for (var i = 0 ; i < list.length; ++i) {
|
||||
if (pred(list[i])) return list[i];
|
||||
}
|
||||
return null;
|
||||
}
|
||||
static any(list:List, pred:Function) {
|
||||
for (var i = 0 ; i < list.length; ++i) {
|
||||
if (pred(list[i])) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
static reversed(array) {
|
||||
var a = ListWrapper.clone(array);
|
||||
return a.reverse();
|
||||
|
9
modules/facade/src/math.dart
Normal file
9
modules/facade/src/math.dart
Normal file
@ -0,0 +1,9 @@
|
||||
library angular.core.facade.math;
|
||||
|
||||
import 'dart:math' as math;
|
||||
|
||||
class Math {
|
||||
static num pow(num x, num exponent) {
|
||||
return math.pow(x, exponent);
|
||||
}
|
||||
}
|
1
modules/facade/src/math.es6
Normal file
1
modules/facade/src/math.es6
Normal file
@ -0,0 +1 @@
|
||||
export var Math = window.Math;
|
Reference in New Issue
Block a user