Skip to content

Instantly share code, notes, and snippets.

@tilmanschweitzer
Last active August 29, 2015 14:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tilmanschweitzer/8bfefea087b1951e7b72 to your computer and use it in GitHub Desktop.
Save tilmanschweitzer/8bfefea087b1951e7b72 to your computer and use it in GitHub Desktop.
var scopeElements = Array.prototype.slice.apply(document.querySelectorAll(".ng-scope"));
var scopes = scopeElements.map(function (element) {
return angular.element(element).scope();
});
var scopeIds = scopes.map(function(scope) {
return scope.$id;
});
var uniqueScopeIds = scopeIds.filter(function(scopeId, index){
return scopeIds.indexOf(scopeId) === index;
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment