Skip to content

Instantly share code, notes, and snippets.

@jandudulski
Created August 23, 2013 14:47
Show Gist options
  • Save jandudulski/6320159 to your computer and use it in GitHub Desktop.
Save jandudulski/6320159 to your computer and use it in GitHub Desktop.
Api = ($http) ->
{
games: {
query: ->
$http.get('/games', params: {format: 'json'})
}
}
angular.module('got').factory('Api', ['$http', Api])
Api = ($http) ->
this.games = {
query: ->
$http.get('/games', params: {format: 'json'})
}
return
angular.module('got').service('Api', ['$http', Api])
// better look
Api = function($http) {
}
Api.prototype.games = function() {
return {
query: function() {
$http.get('/games', params: {format: 'json'});
}
}
}
angular.module('got').service('Api', ['$http', Api]);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment