How do I search through scope variables in Google Chrome Developer Tools?
You'll need to add a script to the console so that you can actually perform a search, as the Developer Tools don't allow for this by default. Here's that function for you (See my Gist comment below for an update):
function scanScope(whatToScan, scanValue) {
for (var key in whatToScan) {
if (whatToScan[key] == scanValue) {
console.log(key + ' = ' + whatToScan[key]);
} else {
if( (typeof whatToScan[key] === "object") && (key !== null) ) {
scanScope(whatToScan[key], scanValue);
}
}
}
}
Copy and paste that into the console, and then call it with the scope you want to search through and the value you want to search for. Be careful that you don't search too large an object, of course. If you're programming in Angular, for instance, and following the "always have a dot" rule, you can scan through it with a call like:
scanScope($scope.model, 'Fred');