angular foreach的使用

var myAppModule = angular.module('myApp', []);
var values = {
name : 'misko',
gender : 'male',
"a" : "aa"
};
var log = [];
var l = angular.forEach(values, function(value, key) {
this.push(key + ': ' + value);
}, log);
alert(l.a);

alert(log);


posted @ 2014-02-17 20:54  小小架构师  阅读(207)  评论(0编辑  收藏  举报