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

前端 未结 3 777
滥情空心
滥情空心 2021-01-03 20:45

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

3条回答
  •  情书的邮戳
    2021-01-03 21:33

    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;
        }];
    }
    

提交回复
热议问题