Skip to content

Instantly share code, notes, and snippets.

@dvidsilva
Created August 29, 2014 02:51
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 dvidsilva/4d61a4243c7a4e917363 to your computer and use it in GitHub Desktop.
Save dvidsilva/4d61a4243c7a4e917363 to your computer and use it in GitHub Desktop.
function promises thingie angularjs
f.getCallHistory = function(){
var request = $http({
data: {
method: 'doctors.get_member_history',
id: f.id,
params: {
call_id : f.call_id
},
jsonrpc: '2.0'
},
method: 'POST',
url: 'somURl'
});
return request.then(function(data) {
// this is success
} , function(data) {
/// this is error
});
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment