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
@uiur
Copy link

uiur commented May 3, 2014

This gist is helpful, thanks!

@bcherny
Copy link

bcherny commented May 22, 2014

+1 very helpful, thanks!

@netantho
Copy link

netantho commented Jun 1, 2014

Just what I was looking for, thanks!

@beezee
Copy link

beezee commented Jun 30, 2014

I just lost an hour on this, so dumb.

@jasminetsai
Copy link

Thank you you just saved me so much headache.

@RaVbaker
Copy link

RaVbaker commented Sep 2, 2014

Other way is to just put a return instead of null. Because return looks more meaningful and explains that it's an issue of coffeescript.

@johngeorgewright
Copy link

Thank you. This was driving me crazy.

@Piioo
Copy link

Piioo commented Oct 10, 2014

Thx πŸ‘

@TimDumol
Copy link

Thank you, this saved so much time!

@mbfisher
Copy link

Good work! πŸ‘

M

@jasocox
Copy link

jasocox commented Nov 19, 2014

Saved me as well!

@itmammoth
Copy link

+1 Great!!!

@cemeng
Copy link

cemeng commented Dec 3, 2014

YEAH .. πŸ’― πŸ‘

@leonardfactory
Copy link

Thank you so much πŸ‘

@sonicoder86
Copy link

so much win for CoffeeScript

@ryu1kn
Copy link

ryu1kn commented Feb 28, 2015

Thanks πŸ‘

@iurii-kondratiuk-zz
Copy link

Thank you. It's very helpful!!

@beholderrk
Copy link

Thanks πŸ‘

@damien-m
Copy link

Another victim of coffeescript to add to the list!
Thanks!
πŸ‘

@quidproquo
Copy link

You just saved me a ton of time, thanks!

@bennythomps
Copy link

Thank you! πŸ‘

@fniewijk
Copy link

fniewijk commented Oct 9, 2015

Cheers! πŸ‘

@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