I'm getting the following error and I cannot understand why. I tried my best to change/check the origin of the error, but for me everything seems to be correct. And this error happens only in production, in development it works fine.
#error
Uncaught Error: [$injector:modulerr] Failed to instantiate module recipeApp due to:
Error: [$injector:nomod] Module 'recipeApp' is not available! You either misspelled the module name or forgot to load it. If registering a module ensure that you specify the dependencies as the second argument.
#app.js
var mod = angular.module('recipeApp',[]);
#application.js
//= require jquery
//= require jquery_ujs
//= require pixel-admin.min
//= require app
#config/initializers/productio.rb
config.assets.compile = false
config.assets.precompile = ['*.js', '*.css']
config.assets.js_compressor = Uglifier.new(:mangle => false)
config.assets.js_compressor = :uglifier
#app/views/layout/application.html.erb
<body class="theme-default no-main-menu main-navbar-fixed" ng-app="recipeApp">
and when I check the source via firebug, I can see recipeApp in both js and html
I'm using
- Rails 4.1.5
- Angularjs 1.2.13
UPDATE
For routing I'm using ui.router, how ever I tried to add that as well, but still the same
#app/views/layouts/application.html.erb
<script src="//ajax.googleapis.com/ajax/libs/angularjs/1.2.4/angular.js"></script>
<script src="//angular-ui.github.io/ui-router/release/angular-ui-router.js"></script>
in my
app/assets/javascripts/app.js
'use strict';
angular.module('recipeApp',["ui.router"]);