Skip to content

Instantly share code, notes, and snippets.

@rikukissa
Created June 5, 2014 14:23
Show Gist options
  • Save rikukissa/175141d5850d09fb3ccd to your computer and use it in GitHub Desktop.
Save rikukissa/175141d5850d09fb3ccd to your computer and use it in GitHub Desktop.
Angular service with coffeescript
module.exports = ['$rootScope', 'Restangular', class FooService
constructor: (@$rootScope, @Restangular) ->
$rootScope.on '$foo', ->
# ...
getBars: ->
@Restangular.all('bars').getList()
module.exports = ['$rootScope', 'Restangular', ($rootScope, Restangular) ->
$rootScope.on '$foo', ->
# ...
@getBars = ->
Restangular.all('bars').getList()
return
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment