I am extending a Rails gem that generates AngularJS-style scaffolding for Rails apps, see https://github.com/explainer/angularjs_scaffold. I have added CoffeeScript language support to a fork from https://github.com/patcito/angularjs_scaffold.
I am getting the error mentioned in the title when I attempt to deploy in production mode, and the javascript code gets minified and obfuscated by the rails asset pipeline. I have read the "Note on minification" at http://docs.angularjs.org/tutorial/step_05 and have used the 'array' design pattern mentioned there, but the app still breaks.
The scaffolding generates 2 app-level angular controllers, a dummy WelcomeCtrl, and a CsrfCtrl to handle security tokens. For each model, 4 REST-style controllers are generated, index, show, create, edit.
I am stumped. I am requesting that some good person build a small rails app, with one simple model, say
rails g scaffold Todo body:string, done:boolean
Please include my gem in the :development group in the Gemfile
gem 'angularjs_scaffold', git: "git@github.com:explainer/angularjs_scaffold.git"
and follow the instructions in the README.md to install the generator and run it against your model,
rails g angularjs:install --language=javascript
rails g angularjs:scaffold Todos
Then, inspect the files added to the app/javascripts folder:
and see if you can see where I am not handling the angularjs dependency injection requirements correctly.
I really appreciate any and all help on this matter.
P.S. I added a sample app, Plink, at https://github.com/explainer/plink, so just inspect the files mentioned above and find my bugs or omissions.
I have made the test app public on github, sorry for the oversight.
A good guy found my problem, it was an omission of a single place where explicit dependency injection was required. I had overlooked it. Thanks, Jeff.