I am so annoyed with AngularJS ! I've designed my modules using the following syntax:
angular.module('myModule.controllers').controller('someCtrl',
['$scope', '$route', 'someService', function ($scope, $route, someService) {
someService.getData.success(function(){});
}
And everything used to work fine... until yesterday when I realized that I needed to use resolve in my routes so that I can delay the rendering of my views until all data is returned from my datacontext service and all promised are resolved.
However, that means I have to change the syntax above to:
function someCtrl($scope, $route, someService) {
}
someCtrl.resolve = {
// get data from here
}
someCtrl.$inject = ['$scope', '$route', 'someService'];
So that in my route definition I can do:
controller: someCtrl,
resolve: someCtrl.resolve
I don't like the above syntax. I much preferred what I used to do (the minification-friendly syntax).
Now the problem is, using the new syntax, how do I assign someCtrl to the angular module 'myModule.controllers' that I had defined before ?