Skip to content

Instantly share code, notes, and snippets.

@jbrowning
Last active April 25, 2016 23:38
Show Gist options
  • Save jbrowning/9527280 to your computer and use it in GitHub Desktop.
Save jbrowning/9527280 to your computer and use it in GitHub Desktop.
Angular & CoffeeScript: Error: [ng:areq] Argument 'fn' is not a function, got Object
# The $provide service is used to override an injected dependency
# Bad - results in Error: [ng:areq] Argument 'fn' is not a function, got Object
module 'someModule', ($provide) ->
$provide.value "SomeService", SomeMock
# Good
module 'someModule', ($provide) ->
$provide.value "SomeService", SomeMock
null
@nicgirault
Copy link

Thank you!

@wwwdata
Copy link

wwwdata commented Nov 25, 2015

holy shit this saved my day too thanks 👍
u really shouldnt use coffeescript just because of these implicit returns ..

@chrisdambrosio
Copy link

tips hat

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