When I invoke the function
getAllUsers() {
return this.http.get(this.url);
}
using:
this.UserService.getAllUsers().subscribe(res => {
console.log(res);
})
The result is:
[{id:1, name:'anna'}, {id:2, name:'john'}, {id:3, name:'victor'}]
However, my goal is to get an array with only names:
['anna', 'john', 'victor']
Is there a solution to accomplish this?