Unknown Provider e-provider error while using angularjs and ruby on rails

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 browser console:

Unknown provider: eProvider <- e

However it works fine on development environment.

I am accesing the below service from one of my javascript files.. for eg:-

userList. storeActorListWithId()

My service is the following:-

 woi.service('userList',['$rootScope', 'userAPI' , 'recoAPI', function($rootScope, userAPI, recoAPI){

    var actorList = [];
    var actorId = "";
    return{
        storeActorListWithId: function(data){
            actorList = [];
            angular.forEach(data,function(actor){
                if(actor.castname)
                {
                    actorList.push({name: actor.castname,id: actor.castid});
                }
            })
        } ,
        getActorListWithId: function(){
            return actorList;
        },
        storeActorId: function(id){
            actorId = id;
        },
        getActorId: function(){
            return actorId;
        }
    }

}]);

My application.js file is as follows.Is it minification safe or not.

 resolve: {
                checkActorId: function($route,$location,$rootScope){
                    var url = $route.current.params.id;
                    var actorName = url.replace(/\-/g, " ").replace(/\~/g, "-").replace(/\$/g, "/");
                    var  actorList = $rootScope.storeActorNameAndId;
                    if($rootScope.storeActorNameAndId){
                        angular.forEach(actorList, function(actor, key){
                            if(actor.name == actorName){
                                $rootScope.actorid = actor.id;
                            }
                        });
                    }
                    else
                    {
                        $location.path("home")
                    }
                }
            }

I have tried many solution(use of DI) given on the website but none of them is helping me. Please Help me..

Thanks in advance

Answers


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

Need Your Help

How do I execute raw SQL in a django migration

django postgresql database-partitioning django-migrations

I am aware of the cursor object in Django. Is there any other preferred way to execute raw SQL in migrations? I want to introduce postgresql partitioning for one of my models tables. The partition ...

Access mysql remote database from command line

mysql shell mysql-error-2003

I have a server with Rackspace. I want to access the database from my local machine command line.