在藉助於每個循環讀取數據之後。數據正在成功填充。 我正在嘗試推送名爲test Data的數組中的對象,但它失敗。推不工作。 以下是我的代碼。推不工作
$scope.testData=[];
data.content.forEach(function(column) {
var objects = {
ip: "",
user: "",
date_created:""
};
objects.ip = column.ip;
objects.user = column.username;
var d = new Date(column.created);
var a = d.toUTCString();
objects.date_created = a;
testData.push(objects);
});
$scope.safeApply();
}, function(error){
console.log(error);
});
推動力在哪裏? –