What are the differences in angular controller notation?

I've seen a couple of notes for initializing a controller in angular, these are:

app.controller('nameCtrl', function($scope, ... ){})

      

and

app.controller('nameCtrl', ['$scope','...',function($scope,...){}])

      

Both work, but I couldn't find anything in the documentation that highlights the differences, doesn't it matter?

+2


source to share


1 answer


app.controller('nameCtrl', function($scope, ... ){})

      

The above won't work with minification, but below will.



app.controller('nameCtrl', ['$scope','...',function($scope,...){}])

      

+4


source







All Articles