Attempting to store data in a sub-array (nested array) but despite receiving good response data, the values are not being pushed into the subarray. Instead, an empty array is returned.
for (var j=0;j<this.imagesdataarray.length;j++){
this.http.get("http://api.interiordesigns2020.com/api/services/app/ImageProject/GetAll?ProjectID="+this.imagesdataarray[j].projectid+"&MaxResultCount="+10000).subscribe( (res:any) =>{
this.data=res;
for (var k in this.data.result.items.length){
this.imagesdataarray[j].imagesnamearray.push({image:this.data.result.items[k].imageFiles,imagename:this.data.result.items[k].imageName,imageid:this.data.result.items[k].id ,completeimagepath:this.globalshare.websiteurl+"/images/UploadedWork/"+this.userid+"/"+this.imagesdataarray[j].projectid+"/"+ this.data.result.items[k].imageName});
}
});
}
}, 2000);