0

I have my controllers set up using array injection, however as the number of services that I pass to the controller increases I will be repeating each one twice - in the array and as a parameter.

I found from the following question Injecting a service into another service in angularJS that I did not have to use array injection, which means no repeating, but it causes problems with minification. However as John Ledbetter commented, it isn't a issue if using ngmin.

My question is, if I use the following definition:

appControllers.controller('LoginController', function($scope, $rootScope, $localStorage, myService1, myService2) {

Instead of:

appControllers.controller('LoginController', [ '$scope', '$rootScope', '$localStorage', 'myService1', 'myService2',
  function($scope, $rootScope, $localStorage, myService1, myService2) {

Is there any implications other than needing to use ngmin when minifying with grunt?

Community
  • 1
  • 1

1 Answers1

1

I am using grunt for concatenating and minifying my angular files. The answer to your question is no, there will be no implications other than needing to use ngmin.

I recommend you use ng-annotate which has improved to be much better than ngmin.

DineshKP
  • 364
  • 2
  • 12