Q:

AngularJs - get list of all registered modules

Can I get a list of all registered modules at run time? 
For example:
// Some code somewhere in some .js file
var module1 = angular.module('module1', []);

// Some code in some other .js file
var module2 = angular.module('module2', []);

// Main .js file
var arrayWithNamesOfAllRegisteredModules = .....

// (result would be: ['module1', 'module2'])

A:

Angular does not provide a way to retrieve the list of registered modules (at least I was not able to find a way in source code).  You can however decorate angular.module method to store names in array.  Something like this:
(function(orig) {
    angular.modules = [];
    angular.module = function() {
        if (arguments.length > 1) {
            angular.modules.push(arguments[0]);
        }
        return orig.apply(null, arguments);
    }
})(angular.module);

Now you can check angular.modules array. 
Demo: http://plnkr.co/edit/bNUP39cbFqNLbXyRqMex?p=preview

A:

You can simply do : 
console.log(angular.module('ModuleYouWantToInspect').requires);

It should return of an array of  strings (dependencies).  You can do the same for the output. 

A:

If you're debugging, I discovered you can get the list by:
Find or add code to invoke run() from any module with any body, say:
angular.module('myModule') 
    .run(function() {})

Put a breakpoint on the .run, and step into angular.run().   There's an object called "modules" in scope that has all the modules as properties, by name.   
This may work with other module methods too, or be accessible from code; I haven't tried very hard to understand the larger picture.