Unknown Provider e-provider error while using angularjs and ruby on rails
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; }];}
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