I have http.get and it's impossible for me to create array of objects. Can you help me ? I need to create loop on array of returned objects and i can't do this.
export class Link {
idStat: String;
idAccount: String;
}
links: Link [];
router.get('/linkGetAll', function(req, res, next) {
Link.find(function (err, products) {
if (err) return next(err);
res.json(products);
});
});
getAllLinks(){
return this.http.get('/main/linkGetAll');
}
this.api.getAllLinks().subscribe((data) => {
this.links = data;
})
for(let item in this.links)
{
DOESN'T WORK
}