Created
February 16, 2015 15:09
-
-
Save michiel/78b0cc814a0e1ec0faed to your computer and use it in GitHub Desktop.
list-angular-modules
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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