Error on crash: [$ injector: unpr] Unknown provider: eProvider <- e when deploying to a hero

I encountered this error: Failed Error: [$ injector: unpr] Unknown provider: eProvider <- e after successful deployment to Heroku

I am using angular social share btw: https://github.com/djds4rce/angular-socialshare

removing the run function and the module name djds4rce.angular-socialshare does not cause an error, but I really need to share Fb.

 //= require_self //= require_tree ./angular MyApp = angular.module( "MyApp", ["ui.router", "ngCsv", "ui.bootstrap", "ngResource", "templates", "angularFileUpload", "ngSanitize", "ngCookies", "textAngular", "djds4rce.angular-socialshare"] ).run(function($FB){ $FB.init('1438666983087556'); }); 

Any idea (s)? Thanks.

+5
source share
2 answers

Rails reduces js, so you need to use a different syntax:

 MyApp = angular.module( "MyApp", ["ui.router", "ngCsv", "ui.bootstrap", "ngResource", "templates", "angularFileUpload", "ngSanitize", "ngCookies", "textAngular", "djds4rce.angular-socialshare"] ); MyApp.run(['$FB', function($FB){ $FB.init('1438666983087556'); }]); 
+6
source

Right, I have to change my coffescript file to

 @HomeCtrl = ['$scope', '$location', ($scope, $location) -> $scope.things = ['Angular', 'Rails 4.1', 'Working', 'Together!!'] ] 

to make it work. Pay attention to "$ scope", "$ location"

+2
source

Source: https://habr.com/ru/post/1201567/


All Articles