I am looking to transform the current API response object into a more structured format.
Current Output
let temp = [
{
"imagePath": "",
"imageDescription": [
{
"language": "en",
"text": "Today's News Updated"
}
]
},
{
"imagePath": "",
"imageDescription": [
{
"language": "en",
"text": "test"
}
]
},
{
"imagePath": "",
"imageDescription": [
{
"language": "de",
"text": "test"
}
]
},
]
Desired output
let temp = {
"imagesList": {
"en": [{
"imagePath": "",
"text": "Today's News Updated"
},
{
"imagePath": "",
"text": "test"
}],
"de": [{
"imagePath": "",
"text": "test"
}]
}
}
How can I achieve this in angular using typescript to display it in the view?
Please refer to the Sandbox Link below: Sandbox Link