1

I tried to minified my js using gulp --production but it breaks my .js and the error s about ui-grid

Error: [$injector:unpr] Unknown provider: eProvider <- e <- GridOptions <- Grid <- gridClassFactory

My index.html:

<script src="bower_components/angular-ui-grid/ui-grid.min.js"></script>

Feedback.js:

angular.module('app')
.controller('feedbackCtrl', ['$scope', '$http', '$timeout', 'Feedback', '$uibModal', 'APIROOT', feedbackCtrl]);

function feedbackCtrl($scope, $http, $timeout, Feedback, $uibModal, APIROOT) {
var vm = this;
var params = '';

$http.get(APIROOT + 'users', {params: {is_head: 0}})
    .then(function (resp) {
        $scope.userList = resp.data;
    });

vm.gridOptions = {
    columnDefs: [
        {field: 'id'},
        {field: 'title'},
        {name: 'Username', field: 'user.username'},
        {field: 'rating'},
        {field: 'content', cellTemplate: '<div class="ui-grid-padding">{{ row.entity.content | limitTo:35 }}</div>'},
        {
            name: ' ', cellTemplate: '<div class="ui-grid-padding"><a class="btn btn-xs btn-success waves-effect waves-light" ' +
        'ng-click="grid.appScope.detail(row.entity.id)"><i class="fa fa-eye"></i></a> ' +
        '<a class="btn btn-xs btn-danger waves-effect waves-light" ng-click="grid.appScope.delete(row.entity.id)"> ' +
        '<i class="fa fa-close"></i></a></div>',
            enableSorting: false, enableFiltering: false
        }
    ]
};

loadData(0);

function loadData(id) {
    vm.loading = true;
    Feedback.query({id: id}, function (resp) {
        vm.loading = false;
        return vm.gridOptions.data = resp.feedbacks;
    })
}

}

I not found any clue at the documentation ui-grid

Any solution?

ssuhat
  • 7,387
  • 18
  • 61
  • 116
  • Possible duplicate of ["Unknown provider: aProvider <- a" How do I find the original provider?](http://stackoverflow.com/questions/21688681/unknown-provider-aprovider-a-how-do-i-find-the-original-provider) – mzulch Jan 19 '16 at 09:01
  • @mzulch looks same. but his solution almost identical with my code. – ssuhat Jan 19 '16 at 09:04
  • There's some guidance in there on how to use the debugger to find the offending code, which might be useful – mzulch Jan 19 '16 at 09:07

0 Answers0