diff --git a/panel/components/inspected-app/inspected-app.js b/panel/components/inspected-app/inspected-app.js index 451b1ed..d87c86b 100644 --- a/panel/components/inspected-app/inspected-app.js +++ b/panel/components/inspected-app/inspected-app.js @@ -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). diff --git a/panel/scopes/scopes.js b/panel/scopes/scopes.js index 7dde851..c886b57 100644 --- a/panel/scopes/scopes.js +++ b/panel/scopes/scopes.js @@ -23,6 +23,7 @@ function ScopesController($scope, inspectedApp) { function inspectScope(scopeId) { $scope.watch(scopeId); $scope.inspectedScope = scopeId; + inspectedApp.inspectScope(scopeId); }; }