Skip to content

Instantly share code, notes, and snippets.

@oliverm2112
Last active December 16, 2015 10:28
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oliverm2112/5420029 to your computer and use it in GitHub Desktop.
Save oliverm2112/5420029 to your computer and use it in GitHub Desktop.
Sample POST function
service.post = function (data) {
$http({
method : 'POST',
url : CFGATEWAY,
data : data
})
.success(function (data, status, headers, config) {
console.log('Post OK!!!', data);
$rootScope.$broadcast(name + '.success', data);
})
.error(function (data, status, headers, config) {
console.log('POST error', data);
$rootScope.$broadcast(name + '.error', 'data:', data, 'status:', status, 'headers:', headers);
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment