While this thread sums up the following three code styles:
1)
angular.module('mainCtrl', []);
function MainCrl($scope, $rootScope) {}
2)
angular.module('mainCtrl',[])
.controller('MainCtrl', function($scope, $rootScope)) { ... });
3)
angular.module('mainCtrl',[])
.controller('MainCtrl', ['$scope', '$rootScope', function(scope, rootScope)) { ... }]);
there's a fourth way i've seen in this video that is very appealing for me
4)
var controllers = {}
controllers.mainCtrl = function($scope, $rootScope){ };
app.controller(controllers)
I am leaning towards continuing with 4), will it break if minified or are there any other drawbacks? Should i just go with 3) since it seems to be the standard way of doing it?