I used Gulp to minify my entire js files. Once minified I got an error like the following:
[$injector:unpr] Unknown provider: eProvider <- e <- makeErrorsDirective.
I had a Custom directive in my controller file.
var myhubdashboardControllers = angular.module('vpdashboardmodule', []);
.directive('mhDashboard', function ($http, authService, apiService) {
return {
restrict: 'EA',
scope: {
name: '@',
dash: '@',
report: '@',
disname: '@',
disdesc: '@',
distot: '@'
},
templateUrl: 'views/dashboard/dashboard-direc.html',
link: function (scope, element, attr) {
scope.linkChk = scope.name;
switch (scope.linkChk) {
case 'Shipped This Week':
scope.url = 'erp/JobShipmentList/PostCpsVwShipmentCount';
scope.shipstatus = "Departure";
scope.period = "ThisWeek";
scope.basicfilter = "Open";
scope.linkName = "Shipments";
scope.linkDesc = "Shipped This Week";
break;
}) };
This is the code used in my application.
There is a reason why you have to inject services and controller in string array.
if you want to inject scope to controller, you have to use
Minification will change the variable names and if you don't use that array of strings while injecting services or controllers, it will be like
So, angular will not be able to understand what 'e' stands for, hence the error. Always remember that the order is also important.