I am using Angular 2+ ,
The api json response is like below,
{
data:[
{name: "2020-04-28", value: "1", label: "current"}
{name: "2020-04-28", value: "2", label: "target"}
{name: "2020-04-29", value: "2", label: "current"}
{name: "2020-04-29", value: "3", label: "target"}
{name: "2020-04-30", value: "6", label: "current"}
{name: "2020-04-30", value: "7", label: "target"}
]
}
I have to change above api responce format into,
{
data: [
{
name: "Current",
value: [1, 2, 6]
},
{
name: "Target",
value: [2, 3, 7]
}
]
}
Can anybody help me to change the format of the json response and please give me the explanation for me to understand the code.
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…