所以,我有一個與這個問題類似的情況,它“應該”起作用但不起作用

這就是 sessionStorage 中的樣子:

我只想做我一直在做的事情: response.message 或 response.whatever 給我什么是“內部”訊息,出于某種原因,無論我做什么,它都不起作用。
這是我收到訊息回應的代碼部分
globalService.commonService('getData', reqPkg).then((response) => {
$scope.theReport.data = JSON.parse(response);
});
如果我這樣做,我會不確定
$scope.theReport.data = JSON.parse(response.message);
我也試過 JSON.stringify,結果相同。
這是來自上一個問題,它作業正常,實際上只是物件陣列中的物件。
const arrResult = Object.keys(objCount).map(k => ({'name': k, 'displayName': k, 'count': objCount[k] }));
uj5u.com熱心網友回復:
$scope.theReport.data = JSON.parse(response).message;將訊息中的所有條目獲取到$scope.theReport.data. 您的回應是一個字串,因此決議回應并從中獲取訊息鍵。
轉載請註明出處,本文鏈接:https://www.uj5u.com/gongcheng/365837.html
標籤:javascript 数组 json
上一篇:js:獲取物件陣列的列
