Modules have _invokeQueue, which contains the contents of the module. A function like this:
function Directives(module) {
var directives = [];
var invokes = angular.module(module)._invokeQueue;
for (var i in invokes) {
if (invokes[i][1] === "directive") directives.push(invokes[i][2]);
}
return directives;
}
will go through the module and capture every element in the call queue, which are marked as directives.
Here is a fiddle where you can play with it.
EDIT: I made this a little more general, as I am not sure which case you wanted.
, , . http://jsfiddle.net/V7BUw/2/.
, require:
for (var j in module.requires) {
Directives(module.requires[j], directives);
}
, !