Я успешно возвратил объект (магазин), который искал, но теперь я хочу перебрать массив операторов и распечатать его для магазина. Я не могу использовать jQuery $ each () для итерации. Что я могу сделать? Спасибо, я ценю вашу помощь.
totals.js (мой сервис)
export const baseUrl = '/src/areas/store-totals/services/tender-total-data.json';
export const all = args =>
// http.post.standard(baseUrl + 'orders/tenderTotals', {}, args);
http.get(baseUrl).
then(function onSuccess(response) {
console.log("The response is :" , response);
}).
catch(function onError(response) {
console.log(response);
});
тендер полного data.json
{
"stores": [
{
"storeName": "Master Bistro",
"storeId": "3046",
"attendants": [
{
"attendantName": "Janis Joplin",
"attendantId": "9784526",
"total": 2000,
"tenderTotal": {
"Cash": 500,
"TC": 0,
"UOD": 500,
"MC": 250,
"VI": 250,
"AX": 250,
"DI": 250,
"JC": 0,
"DC": 0,
"UOP": 0,
"GN": 0,
"UOGC": 0,
"HOTEL": 0,
"NCTNCG": 0
}
},
{
"attendantName": "David Bowie",
"attendantId": "2589456",
"total": 14675,
"tenderTotal": {
"Cash": 175,
"TC": 0,
"UOD": 100,
"MC": 9500,
"VI": 3500,
"AX": 550,
"DI": 850,
"JC": 0,
"DC": 0,
"UOP": 0,
"GN": 0,
"UOGC": 0,
"HOTEL": 0,
"NCTNCG": 0
}
},
{
"attendantName": "Michael Jackson",
"attendantId": "5478264",
"total": 15599,
"tenderTotal": {
"Cash": 250,
"TC": 0,
"UOD": 80,
"MC": 5624,
"VI": 6895,
"AX": 2500,
"DI": 250,
"JC": 0,
"DC": 0,
"UOP": 0,
"GN": 0,
"UOGC": 0,
"HOTEL": 0,
"NCTNCG": 0
}
}
],
"message": "Store totals for 08/20/2018",
"date":"08/20/2018"
},{
"storeName": "The Master Marketplace",
"storeId": "3047",
"attendants": [
{
"attendantName": "Dirk Novitski",
"attendantId": "9784527",
"total": 2000,
"tenderTotal": {
"Cash": 500,
"TC": 0,
"UOD": 500,
"MC": 250,
"VI": 250,
"AX": 250,
"DI": 250,
"JC": 0,
"DC": 0,
"UOP": 0,
"GN": 0,
"UOGC": 0,
"HOTEL": 0,
"NCTNCG": 0
}
},
{
"attendantName": "Carmello Anthony",
"attendantId": "2589458",
"total": 14675,
"tenderTotal": {
"Cash": 175,
"TC": 0,
"UOD": 100,
"MC": 9500,
"VI": 3500,
"AX": 550,
"DI": 850,
"JC": 0,
"DC": 0,
"UOP": 0,
"GN": 0,
"UOGC": 0,
"HOTEL": 0,
"NCTNCG": 0
}
},
{
"attendantName": "Stevie Wonder",
"attendantId": "5478266",
"total": 15599,
"tenderTotal": {
"Cash": 250,
"TC": 0,
"UOD": 80,
"MC": 5624,
"VI": 6895,
"AX": 2500,
"DI": 250,
"JC": 0,
"DC": 0,
"UOP": 0,
"GN": 0,
"UOGC": 0,
"HOTEL": 0,
"NCTNCG": 0
}
}
],
"message": "Store totals for 08/22/2018",
"date":"08/21/2018"
}
]
}