Reputation: 194
I'm developing an MVC application with angular JS. I have enabled the minification of scripts using
BundleTable.EnableOptimizations = true;
in the BundleConfig.cs. To avoid minification of dependency variable I used injection as given below.
app.controller("HomeController", ['$scope', 'HomeService', 'DTOptionsBuilder', 'DTColumnBuilder', 'DTColumnDefBuilder', HomeController]);
HomeController is the name of the function. It is working fine. Recently I found that, we can user controllerName.$inject to do the same. SO I tried it as given below.
HomeController.$inject['$scope', 'HomeService', 'DTOptionsBuilder', 'DTColumnBuilder', 'DTColumnDefBuilder'];
It didn't worked for me. Before doing this, I tried this method in a test project with only $scope variable. it worked. So what is the issue and how can I fix this. Please help me.
Upvotes: 0
Views: 88