Skip to content

Instantly share code, notes, and snippets.

@aegiz
Last active November 7, 2015 09:36

Revisions

  1. aegiz revised this gist Nov 7, 2015. No changes.
  2. aegiz renamed this gist Nov 7, 2015. 1 changed file with 0 additions and 0 deletions.
    File renamed without changes.
  3. aegiz created this gist Nov 7, 2015.
    1 change: 1 addition & 0 deletions gistfile1.txt
    Original file line number Diff line number Diff line change
    @@ -0,0 +1 @@
    javascript:(function () { var root = angular.element(document.getElementsByTagName('body')[0]); var watchers = []; var f = function (element) { if (element.data().hasOwnProperty('$scope')) { angular.forEach(element.data().$scope.$$watchers, function (watcher) { watchers.push(watcher); }); } angular.forEach(element.children(), function (childElement) { f(angular.element(childElement)); }); }; f(root); alert(watchers.length);})();