I was doing a test service and from my component when calling the service and wanting to add ".subscribe" it gave me an error that the method was not an observable...
Searching the internet, I managed to solve the problem if I added something like this to my service using .map:
loadAll() {
return this.http.get(this.url)
.map(res => res.json());
}
When adding .map from the component if ".subscribe" worked fine for me.
What I don't understand is what that .map does, I googled but couldn't find any info.
According to what the visual studio code shows me (in English) it is something that takes a result and creates an observable... Could you please clarify what this .map does?
Thank you very much