I have a Rails/AngularJS app which works fine in local development environment. However, when I deployed this app to Amazon Cloud the AngularJS returns this error in the bro
in my case
app.config(function ($stateProvider) {
$stateProvider
.state('A', {
...,
});
});
was changed to
app.config(["$stateProvider", function ($stateProvider) {
$stateProvider
.state('A', {
...,
});
}]);
then minification works
In my case (Rails app), I had to remove the uglifier
gem from my Gemfile
and then remove the config line in config/environments/production.rb
:
config.assets.js_compressor = :uglifier
Finally got the solution after hours of research.
There was problem of minification-safe annotation in resolve block. This code was giving the above error.
resolve: {
setParams: function($rootScope, $route) {
$rootScope.Programmeid = $route.current.params.programmeid;
$rootScope.channelid = $route.current.params.channelid;
}
}
I resolved it by changing the code to this:
resolve: {
setParams: ['$rootScope', '$route', function($rootScope, $route) {
$rootScope.Programmeid = $route.current.params.programmeid;
$rootScope.channelid = $route.current.params.channelid;
}];
}