Created
December 31, 2014 09:50
-
-
Save magmel48/469e37c9cec74dd52923 to your computer and use it in GitHub Desktop.
factory
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
angular | |
.module('app') | |
.factory('staffFactory', [ | |
'$http', 'staffUrl', | |
($http, staffUrl) -> | |
class getStaff | |
constructor: () -> | |
$http | |
.jsonp(staffUrl + '?callback=JSON_CALLBACK') | |
.then(success) | |
.catch(error) | |
class success | |
constructor: (response) -> | |
response | |
class error | |
constructor: (error) -> | |
console.log(error) | |
service = | |
getStaff: getStaff | |
service | |
]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment