for (var siteCounter = 0; siteCounter < audit.SessionSiteList.length; siteCounter++) {
for (var itemCounter = 0; itemCounter < audit.SessionSiteList[siteCounter].AuditItemList.length; itemCounter++) {
var item = audit.SessionSiteList[siteCounter].AuditItemList[itemCounter];
item.TotalItems = audit.SessionSiteList[siteCounter].AuditItemList.length;
item.CurrentItem = itemCounter;
promises.push(function(){return $scope.submitaudit(item)});
}
}
执行承诺时,它们都使用相同的数据。即项目的最后一个assigmnet被所有承诺使用。我如何通过价值?
我可以克隆数据并传递吗?