I have a function that subscribes to a search api. In the map function I would like to map the items to objects. I do not get an error but the response is always empty.
this is my code:
return this.http.get(searchURL)
.map((res: Response) => res.json())
.map(json => json.items.forEach(item => {
new SearchResult(
item.id,
item.title,
item.price
);
}) || []);