Is it possible to from the global window
or window.angular
object loop through all controllers/modules/factories etc. that we have created and is being bootstrapped?
I'm thinking something like:
for(module in window.angular.modules) {
for(ctrl in module.controllers) {
console.log(ctrl);
}
for(factory in module.factories) {
console.log(factory);
}
...
}
Goal: I want to auto-generate some documentation for the app we've created.
Edit: Note that we are not creating global objects when doing controllers. We are registring them directly on the module:
angular.module('ourApp')
.controller('CustomerCtrl', ['$scope', function ($scope) { ... } ]);