Skip to content

Commit 5af28a9

Browse files
committed
feat(count): added limit to max watchers to print
1 parent 9e63e65 commit 5af28a9

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

ng-count-watchers.js

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
watchers = [];
99

1010
var mostWatchers = 0;
11+
var maxWatchersToPrint = 20;
1112

1213
function countScopeWatchers(scope, element) {
1314
test[scope.$id] = true;
@@ -35,6 +36,9 @@
3536
}
3637
}
3738
}
38-
console.log('this page has ' + watchers.length + ' angular watchers and the watchers are:', watchers );
39+
console.log('this page has ' + watchers.length + ' angular watchers');
40+
if (watchers.length < maxWatchersToPrint) {
41+
console.log('the watchers are:', watchers);
42+
}
3943
return count;
4044
}(window.angular));

0 commit comments

Comments
 (0)