Obfuscation AngularJS

I am trying to confuse an angularjs application and it breaks. I know this is a skeleton issue, and they tried to fix it using the $ inject method.

http://docs.angularjs.org/tutorial/step_05 See the “Minimizing Note” section.

To solve this problem, it is recommended to do YourController.$inject = ['$scope', '$http'];

I went ahead and did this to fit my application like this:

 AventosController.$inject = ['$scope','$http','$q','controllerComm']; VforumController.$inject = ['$scope','$http','$timeout','controllerComm']; 

Well, it still doesn't work. The error I get in the console is:

Error: Unknown provider: cProvider <- c <- controllerComm

Anyway, to fix it?

EDIT

controllerComm

 app.factory('controllerComm', ['$rootScope', function($rootScope) { var showVforum = {}; showVforum.result = false; showVforum.prepBroadcast = function(val) { this.result = val; this.broadcastVal(); } showVforum.broadcastVal = function() { $rootScope.$broadcast('toggleVforum') } return showVforum; }]); 

EDIT 2 does not work after obfuscation

 $scope.launchVforum = function() { $scope.installationVideo = ($scope.installationVideo) ? false : true; controllerComm.prepBroadcast($scope.installationVideo); } 
+7
javascript angularjs obfuscation
source share
1 answer

Try entering a controller definition.

 app.controller('myCtrlr', ['$scope', '$http', '$q', 'controllerComm', function ($scope, $http, $q, controllerComm) { ... }]); // end myCtrlr 

Is "controllerComm" also defined?

+7
source share

All Articles