Created
August 29, 2014 02:51
-
-
Save dvidsilva/4d61a4243c7a4e917363 to your computer and use it in GitHub Desktop.
function promises thingie angularjs
This file contains 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
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