Ruby on Rails with AngularJS: "Argument [...] is not a function, got undefined"
I have just spent several hours trying to figure out what is wrong with my newly created application.
Error: Argument [...] is not a function, got undefined
It turns out that problem... can be anywhere.
What's wrong?
It usually means we have forgotten about some braces, colons, semicolons, commas, dots etc. In short, there is a syntax error.
But I have been reading my code very carefully and there was no mistake.
What worked for me?
I named my main javascript file main.js. Don't do it.
Name it app.js instead and everything should be fine.
Written by Sebastian Muszyński
Related protips
2 Responses
After installing angularjs-rails gem. I cant find main.js, and if I create a new file app.js where should I put it?
over 1 year ago
·
I haven't used angularjs-rails gem. However, you should create all your js-related files under app/assets/javascripts folder if it's a typical rails application.
over 1 year ago
·
Have a fresh tip? Share with Coderwall community!
Post
Post a tip
Best
#Rails
Authors
Sponsored by #native_company# — Learn More
#native_title#
#native_desc#