feat(panel/scopes): set window.$scope on scope select

test-unit-sauce
Brian Ford 10 years ago
parent 147cd0b796
commit eb2e7555d4

@ -21,6 +21,13 @@ function inspectedAppService($rootScope) {
return invokeAngularHintMethod('assign', scopeId, path, value);
};
/*
* sets window.$scope to the scope of the given id
*/
this.inspectScope = function (scopeId) {
return invokeAngularHintMethod('inspectScope', scopeId);
};
function invokeAngularHintMethod(method, scopeId, path, value) {
var args = [parseInt(scopeId, 10), path || ''].
map(JSON.stringify).

@ -23,6 +23,7 @@ function ScopesController($scope, inspectedApp) {
function inspectScope(scopeId) {
$scope.watch(scopeId);
$scope.inspectedScope = scopeId;
inspectedApp.inspectScope(scopeId);
};
}