I am new to angular 4 ,Here I need to consume API response and set it to the array .
but in my case it returns [object object].
JSON response Format:
{
"Table": [
{
"S_NO": 1,
"AN_ID": 37,
"AN_TYPE": "Church",
"AN_TITLE": "Donation",
"AN_DATE": "2018-12-05T18:30:00",
"AN_STATUS": "Active",
"AN_DESC": "Test"
}
],
"Table1": [
{
"IMAGES": "http://localhost:49813/Images/Announcements/Church/Donation/IMG_0914.JPG"
},
{
"IMAGES": "http://localhost:49813/Images/Announcements/Church/Donation/IMG_0916.JPG"
},
{
"IMAGES": "http://localhost:49813/Images/Announcements/Church/Donation/IMG_0917.JPG"
},
{
"IMAGES": "http://localhost:49813/Images/Announcements/Church/Donation/IMG_0919.JPG"
},
{
"IMAGES": "http://localhost:49813/Images/Announcements/Church/Donation/IMG_0921.JPG"
}
]
}
app.component.html
for(var i = 0; i <= data; i++){
this.urls.push(data['Table1'][0]['IMAGES']);
}
But it returns [object object].Can anyone help me to fix this .