Skip to content

Instantly share code, notes, and snippets.

@sj26
Last active December 15, 2015 04:20
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save sj26/5201226 to your computer and use it in GitHub Desktop.
Save sj26/5201226 to your computer and use it in GitHub Desktop.
# What about a decorator?
injecting = (inject..., method) ->
method = method.into if method.into?
method.$inject = inject
method
my.angular.directives.directive "mydirective",
injecting "$http", "$lolwhut", into: ($http, $lolwhut) ->
scope:
here: "i"
bind: "=some"
things: "&away"
link: (scope, el, attrs) ->
"WOW I'M DIRECTING"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment