Skip to content

Instantly share code, notes, and snippets.

@michiel
Created February 16, 2015 15:09
Show Gist options
  • Save michiel/78b0cc814a0e1ec0faed to your computer and use it in GitHub Desktop.
Save michiel/78b0cc814a0e1ec0faed to your computer and use it in GitHub Desktop.
list-angular-modules
function listServices(mod, r) {
var inj = angular.element(document).injector().get;
if (!r) {
r = {};
}
angular.forEach(angular.module(mod).requires,
function(m) {
listServices(m,r)
});
angular.forEach(angular.module(mod)._invokeQueue,
function(a) {
try { r[a[2][0]] = inj(a[2][0]); } catch (e) {}
});
return r;
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment