Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typescript/8.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
使用typescript从数组json响应捕获数据_Typescript_Rest - Fatal编程技术网

使用typescript从数组json响应捕获数据

使用typescript从数组json响应捕获数据,typescript,rest,Typescript,Rest,当我尝试时: { "items": [ { "ContestId": 300100183354726, "ContestNumber": "CDRM_11102", "ContestName": "New Contest 58428129", "Description": null, "OwnerId": 100010032636167, "StartDate": "2019-12-12T00:00:00+00:00", "EndDate": "2019-12-22T00:00:00+00:

当我尝试时:

{
"items": [
  {
"ContestId": 300100183354726,
"ContestNumber": "CDRM_11102",
"ContestName": "New Contest 58428129",
"Description": null,
"OwnerId": 100010032636167,
"StartDate": "2019-12-12T00:00:00+00:00",
"EndDate": "2019-12-22T00:00:00+00:00",
"KPIId": 300100180907483,
"CreatedBy": "SALES_MGR",
"CreationDate": "2019-12-12T09:24:26+00:00",
"LastUpdatedBy": "SALES_MGR",
"LastUpdateDate": "2019-12-12T09:24:26.081+00:00",
"LastUpdateLogin": "94FD310D04952F1BE05369B3F20A9266",
"ObjectVersionNumber": 1,
"ConflictId": 0,
"OwnerName": "Todd Beeler",
"OwnerNumber": "100010032636167",
"OwnerUniqueName": "Todd Beeler",
"KPIName": "Appointments Completed",
"KPINumber": "CDRM_6",
"KPIDescription": null
}
],
"count": 1,
"hasMore": false,
"limit": 25,
"offset": 0,
"links": [
  {
"rel": "self",
"href": "https://fuscdrmsmc217-fa-ext.us.oracle.com:443/crmRestApi/resources/11.13.18.05/contests",
"name": "contests",
"kind": "collection"
}
],
}
结果未定义。请帮助我如何获取竞赛号码

我的图书馆:

导出let restResponce={
“responceJSON”:{},
“响应代码”:0,
“responceTEXT”:“,
“requestedValues”:{}
};
试试:

var json=json.parse(json.stringify(response));
document.write(json.items[0].number);

这应该管用

如何填写
restResponce
中的
responceJSON
对象?看起来,
dict
没有被数据填充
{}
对于
responceJSON
contestNumber = await restResponce.responceJSON["items[1].ContestNumber"]