Skip to content

Instantly share code, notes, and snippets.

@chris-skud
Last active August 29, 2015 14:06
Show Gist options
  • Save chris-skud/336a8edf1a24fae9be4d to your computer and use it in GitHub Desktop.
Save chris-skud/336a8edf1a24fae9be4d to your computer and use it in GitHub Desktop.
function get() {
var prom = $http({method:'GET', url: 'test.json'})
.then(function(data) {
//set local value with returned data
vals = data;
// and return to caller so they can .then(function(data){})
return vals;
}, function(err) {
console.log(err);
return err;
});
return prom;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment