I have this http service which returns an object, like for example this:
{
entries: [..,..,..,..],
entries2: [..,..,..],
somevalue: "the value",
somemore: "another value"
}
I'm using Angular's HttpClient, with a http.get(url).
i am able to do this:
http.get(url).map(result=>result['entries'])
when i subscribe on that, i only get the "entries". But i would like to have both the "entries", and "entries2" returned when i subscribe. I just don't understand how to do that. I've googled, for a few hours now, but I'm not even sure what to google for. ;)
So if anyone see what I'm trying to do, and would like to at least put me on the right track, please let me know :)
Thanks in advance.
.map(result => ({entries: result.entries, entries2: result.entries2}));. Bear in mind there is no need to use the square bracket syntax here, so I've just replaced it with dot notation