Skip to content

Instantly share code, notes, and snippets.

@xcarpentier
Created February 4, 2015 14:51
Show Gist options
  • Save xcarpentier/1e5683289cd24e626341 to your computer and use it in GitHub Desktop.
Save xcarpentier/1e5683289cd24e626341 to your computer and use it in GitHub Desktop.
'use strict'
class DataService
@$inject: ['$http', '$log']
constructor: (@http, log) ->
log.debug 'DataService instance'
countries: ->
@http.get('/api/countries/')
angular.module('joyContactWebapp').service 'DataService', DataService
@AllenBlank
Copy link

This is a very pretty way of building a service. Thanks.

@asantibanez
Copy link

Excellent! Thanks! Made my code simpler.

@toverux
Copy link

toverux commented Aug 6, 2015

Hah ! le monde est petit ! Tu avais fait un jeu pour l'EdgeNight je crois ?
Merci pour cet exemple en tout cas, Angular est tellement plus élégant en Coffee.

@codingleo
Copy link

Good code!! Tks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment