Angular 2 http JSON внутри массива не определено
Массив данных Json внутри другого массива не может отображаться в угловых 2 data.result не определен, а data.state_list[0] не определен, пожалуйста, исправьте ошибку
clientdashboard() {
console.log("callwrtety")
this.dashboardclient.getUser().subscribe((data) => {
this.client_dashboardLists = data;
this.client_dashboardLists = data.result;
this.client_dashboardLists = data.state_list[0];
console.log(this.client_dashboardLists);
}
);
Объекты JSON Мне нужно, чтобы результат был представлен в HTML. Я передал значение data.result в http-ответе отображается неопределенное для значения json, результат - массив внутри массива данных json. Результат ниже - данные json.
[{
"average_credit_limit": 4400,
"average_days": 60,
"average_profit": "26.4",
"reseller": [
"A",
"B",
"C",
"D",
"E",
"F",
"G",
"H",
"I",
"J",
"K",
"L",
"M"
],
"result": [
{
"clientcode": "A SILVA DOS REIS COMERCIO ME",
"creditlimit": 6000,
"dayspayable": 60,
"payable": 1650,
"profitmargin": 15,
"receivable": 6056,
"riskranking": 1,
"state": "MA",
"total": 7706
},
{
"clientcode": "IRMAOS GONCALVES COMERCIO E INDUSTRIA LTDA",
"creditlimit": 5000,
"dayspayable": 60,
"payable": 1550,
"profitmargin": 27,
"receivable": 5656,
"riskranking": 2,
"state": "RO",
"total": 7206
},
{
"clientcode": "GM VESTUARIO E ACESSORIOS EIRELI ME",
"creditlimit": 2500,
"dayspayable": 90,
"payable": 1450,
"profitmargin": 25,
"receivable": 5256,
"riskranking": 4,
"state": "TO",
"total": 6706
},
{
"clientcode": "CLEIDE TERESINHA DIAS DA SILVA ME",
"creditlimit": 4000,
"dayspayable": 30,
"payable": 1250,
"profitmargin": 35,
"receivable": 4856,
"riskranking": 3,
"state": "RS",
"total": 6106
},
{
"clientcode": "M M LOBATO ME",
"creditlimit": 4500,
"dayspayable": 60,
"payable": 1500,
"profitmargin": 30,
"receivable": 4456,
"riskranking": 5,
"state": "PA",
"total": 5956
}
],
"state_list": [
"AL",
"AM",
"AP",
"BA",
"CE",
"DF",
"ES",
"GO",
"MA",
"MG",
"MS",
"MT",
"PA",
"PB",
"PE",
"PI",
"PR",
"RJ",
"RN",
"RO",
"RR",
"RS",
"SC",
"SE",
"SP",
"TO"
],
"total_payable": 7400,
"total_receivable": 26280,
"total_return": "6785.92",
"total_risk": "13129.0",
"total_sum": 33680
}]