Skip to content

Instantly share code, notes, and snippets.

View bertrandg's full-sized avatar
:octocat:
 

bertrandg bertrandg

:octocat:
 
  • Lyon, FRANCE
View GitHub Profile
(function(){
var all_ids = [];
var duplicate_ids = [];
$('[id]').each(function(index){ all_ids.push( $(this).attr('id') ) })
all_ids = all_ids.sort();
for (var i = 0; i < all_ids.length - 1; i++) {
if (all_ids[i + 1] == all_ids[i]) duplicate_ids.push(all_ids[i]);
}
console.log('duplicate id: ', duplicate_ids);
})()
.ng-scope {
outline: 1px solid blue;
}
var debugWatchers = function(selector, showExp) {
var target, i, checkInsideFn, jq, items,
nb_watchers = 0,
nb_scopes = 0,
scopes_id = {};
if(typeof jQuery == 'undefined') {
jq = document.createElement('script');
jq.type = 'text/javascript';
jq.src = '//ajax.googleapis.com/ajax/libs/jquery/2.1.1/jquery.min.js';
(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) {