Sebastian
Sebastian

Reputation: 1976

AngularJS, controller error after uglify: Unknown provider: aProvider <- a

The following code snippet creates some mock data that is used in a template. It works before uglification but after I get the "Unknown provider: aProvider <- a" error.

angular.module('myApp').controller('ReportListController', ['$scope', function($scope) {

    $scope.reports = mockData();

    function mockData() {
        var reports = [];
        for(var i = 0; i < 10; i++) {
            reports.push({ ...mock json data... });
        }

        return reports;
    }
}]);

I've read the info on the link provided in the error message (link) and on various similar Stack Overflow questions (that all seemed to be resolved) but I can't see where my code differs from the instructions.

Upvotes: 0

Views: 237

Answers (1)

ShibinRagh
ShibinRagh

Reputation: 6656

Its worked for me - Im using grunt

uglify: {
options: {
  mangle: false
}

Read about ng-annotate

Upvotes: 1

Related Questions