Skip to content

Instantly share code, notes, and snippets.

@gilbox
Created July 12, 2014 20:21
Show Gist options
  • Save gilbox/7e8f5f59e04d860089c6 to your computer and use it in GitHub Desktop.
Save gilbox/7e8f5f59e04d860089c6 to your computer and use it in GitHub Desktop.
svc = function allServices(mod, r) {
var inj = angular.element(document).injector().get;
if (!r) r = {};
angular.forEach(angular.module(mod).requires, function(m) {allServices(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