Last active
December 16, 2015 10:28
-
-
Save oliverm2112/5420029 to your computer and use it in GitHub Desktop.
Sample POST function
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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