angular.forEach
描述:
循环对obj对象的每个元素调用iterator, obj对象可以是一个Object或一个Array. Iterator函数调用方法: iterator(value, key, obj), 其中obj是被迭代对象,key是obj的property key或者是数组的index,value就是相应的值啦. (此函数不能够迭代继承的属性.)
使用方法:
angular.forEach(obj, iterator, [context])
参数详解:
Param Type Details
angular.forEach(obj, function(value,index,objs){}, context);
obj | Object Array | 被迭代的对象. |
iterator | Function | 迭代函数 |
context (optional) |
Object | Object to become context (this) for the iterator function. |
返回值:
对obj的引用
1 2 3 4 5 6 7 8 9 10 11 12 13 |
|