Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Uncaught Error: [$injector:unpr] Unknown provider: eProvider <- e while deploying to heroku

I'm encountering this error: Uncaught Error: [$injector:unpr] Unknown provider: eProvider <- e after a successful deployment to Heroku

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

removing the run function and module name djds4rce.angular-socialshare do not cause error but I badly need that for Fb sharing.

//= 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.

like image 935
rukia_kuchiki_21 Avatar asked Sep 01 '14 13:09

rukia_kuchiki_21


2 Answers

Rails minifies the js, so you have 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');
}]);
like image 83
apneadiving Avatar answered Sep 27 '22 16:09

apneadiving


Thats correct I have to change my coffescript file to

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

in order to make it work. Pay attention to '$scope', '$location'

like image 39
gakshay Avatar answered Sep 27 '22 16:09

gakshay