【发布时间】:2018-07-20 02:49:00
【问题描述】:
响应正文;
[
{
"professionalId": {
"cib_code": "30003",
"thirdPartyId": "RS30004"
},
"nationalIdentifier": "984538926",
"nationalIdType": "SIREN"
},
{
"professionalId": {
"cib_code": "30003",
"thirdPartyId": "RS30008"
},
"nationalIdentifier": "944316926",
"nationalIdType": "SIREN"
}
]
通过使用来自 DB 的 Rest 调用获取 json 响应:
this.thirdpartyServices.getThirdparties().subscribe(data=>this.thirdpartyapis$=data);
在**thirdpartyapis** 对象中获取高于 Json 数组响应
但我想要另一个可以以简单格式包含此数据的对象,例如
[
{
"cib_code": "30003",
"thirdPartyId": "RS30004"
"nationalIdentifier": "984538926",
"nationalIdType": "SIREN"
},
{
"cib_code": "30003",
"thirdPartyId": "RS30008"
"nationalIdentifier": "944316926",
"nationalIdType": "SIREN"
}
]
想在 Typscript 中映射我的数据,以便可以在 Html 中使用相同的对象在 Grid 表中显示数据 请在 angular 2 Typescript 中提出建议
【问题讨论】:
标签: json rest typescript angular2-services