Skip to content

Instantly share code, notes, and snippets.

@evan-007
Created June 15, 2014 04:06
Show Gist options
  • Save evan-007/b8fd23847758a4aa3f13 to your computer and use it in GitHub Desktop.
Save evan-007/b8fd23847758a4aa3f13 to your computer and use it in GitHub Desktop.
.factory('owmNearby', ['owmRequest', '$interpolate', 'OWM_LAT_LNG_PATH',
function(owmRequest, $interpolate, OWM_LAT_LNG_PATH) {
return function(lat, lng) {
var path = $interpolate(OWM_LAT_LNG_PATH)({
lat : lat,
lng : lng
});
return owmRequest(path);
}
}])
first return means that it's called like owmNearby(lat, lng)
and returns 'path'
2nd return is the return from the service?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment