Hi, that’s my first question on forum, sorry if has something wrong with the structure or language.
I was using that kind of function to do GET requests, using map() to treat the responses:
public getSomething(url){
this.http.get(url)
.map(res => res.json())
.subscribe(data => {
this.something = data;
});
}
but recently i removed the map() function and just used JSON.parse(data.text()) :
public getSomething(url){
this.http.get(url)
.subscribe(data => {
this.something = JSON.parse(data.text());;
});
}
because i think that map() walks every node on array and i don’t need that, and JSON.parse just convert the text to JSON object.
That’s correct or it’s all the same or the map() it is the best solution?