我尝试使用gulp --production
缩小我的js,但它会破坏我的.js和关于ui-grid的错误
Error: [$injector:unpr] Unknown provider: eProvider <- e <- GridOptions <- Grid <- gridClassFactory
我的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;
})
}
}
我没有在文档ui-grid
中找到任何线索任何解决方案?