Skip to content

Instantly share code, notes, and snippets.

@magmel48
Created December 31, 2014 09:50
Show Gist options
  • Save magmel48/469e37c9cec74dd52923 to your computer and use it in GitHub Desktop.
Save magmel48/469e37c9cec74dd52923 to your computer and use it in GitHub Desktop.
factory
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