Skip to content

Instantly share code, notes, and snippets.

@bertrandg
Last active August 29, 2015 14:02
Show Gist options
  • Save bertrandg/fd0a11dedb1a977a50da to your computer and use it in GitHub Desktop.
Save bertrandg/fd0a11dedb1a977a50da to your computer and use it in GitHub Desktop.
(function () {
var i, data, scope,
count = 0,
all = document.all,
len = all.length,
test = {};
for (i=0; i < len; i++) {
data = angular.element(all[i]).data();
if (data.hasOwnProperty('$scope') && data.$scope.$$watchers) {
scope = data.$scope;
if (!test[scope.$id]) {
test[scope.$id] = true;
count += scope.$$watchers.length;
}
}
}
console.log('total = ', count);
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment