I use the foursquare api to capture the coordinates of longitude and latitude for the location found, the function is as follows:
getCoordinates(params) {
this.http.get(URL+params)
.map(res => res.json())
.subscribe(
data => this.coordinates = data,
err => this.logError(err)
);
}
I am trying to figure out how to perform certain tasks in case of success or error, therefore, if this is a success case, I want return coordinates, if not to print the error on the console, but not return coordinates. I think that I more or less got an error, but I can’t determine the effect of success (commented on it at the moment, since it is called in case of success and errors)
EDIT: Seeing how this question may appear in the future, what will be the logic for checking success or failure http.post?