AngularJS WebInspector Extension for Chrome
This repository has been archived on 2020-10-11. You can view files and clone it, but cannot push or open issues or pull requests.
Go to file
2012-11-13 19:29:01 -05:00
css fix wrong cursor on d3 visualization 2012-11-13 19:29:01 -05:00
img added icon used in web store 2012-08-02 11:26:08 -07:00
js instrumentation rewrite complete, refactored plugin-app model API 2012-11-13 19:29:01 -05:00
panes instrumentation rewrite complete, refactored plugin-app model API 2012-11-13 19:29:01 -05:00
test refactored panes, renamed TreeCtrl to ModelCtrl 2012-08-01 17:05:03 -07:00
background.html initial revision 2012-07-02 14:09:51 -07:00
devtoolsBackground.html renamed devtools page and js 2012-07-25 15:37:11 -07:00
LICENSE added license 2012-07-19 00:12:14 -07:00
manifest.json update version number to 0.2.1 2012-08-07 12:03:26 -07:00
panel.html moved CSS features to their own service, cleaned up services 2012-11-13 19:29:00 -05:00
README.md fix git clone command in README 2012-09-08 12:25:32 -04:00
testacular.conf initial revision 2012-07-02 14:09:51 -07:00

AngularJS Batarang

Installing from the Web Store

https://chrome.google.com/webstore/detail/ighdmehidhipcmcojjgiloacoafjmpfk

Installing from Source

  1. Clone the repository: git clone git://github.com/angular/angularjs-batarang
  2. Navigate to chrome://chrome/extensions/ and enable Developer Mode.
  3. Choose "Load unpacked extension"
  4. Open the directory you just cloned (should open with Chrome, otherwise try dragging/dropping the file into Chrome) and follow the prompts to install.

Screencast

Check out this screencast that walks you through the Batarang's features.

Using the Batarang

First, navigate Chrome Canary to the AngularJS application that you want to debug. Open the Developer Tools. There should be an AngularJS icon. Click on it to open he AngularJS Batarang.

The Batarang has four tabs: Model, Performance, Options, and Help.

Model

Batarang screenshot

Starting at the top of this tab, there is the root selection. If the application has only one ng-app declaration (as most applications do) then you will not see the option to change roots.

Below that is a tree showing how scopes are nested, and which models are attached to them. Clicking on a scope name will take you to the Elements tab, and show you the DOM element associated with that scope. Models and methods attached to each scope are listed with bullet points on the tree. Just the name of methods attached to a scope are shown. Models with a simple value and complex objects are shown as JSON. You can edit either, and the changes will be reflected in the application being debugged.

Performance

Batarang performance tab screenshot

The performance tab must be enabled separately because it causes code to be injected into AngularJS to track and report performance metrics. There is also an option to output performance metrics to the console.

Below that is a tree of watched expressions, showing which expressions are attached to which scopes. Much like the model tree, you can collapse sections by clicking on "toggle" and you can inspect the element that a scope is attached to by clicking on the scope name.

Underneath that is a graph showing the relative performance of all of the application's expressions. This graph will update as you interact with the application.

Options

Batarang options tab screenshot

Last, there is the options tab. The options tab has two checkboxes: one for "show scopes" and one for "show bindings." Each of these options, when enabled, highlights the respective feature of the application being debugged; scopes will have a red outline, and bindings will have a blue outline.

Elements

Batarang console screenshot

The Batarang also hooks into some of the existing features of the Chrome developer tools. For AngularJS applications, there is now a properties pane on in the Elements tab. Much like the model tree in the AngularJS tab, you can use this to inspect the models attached to a given element's scope.

Console

Batarang console screenshot

The Batarang exposes some convenient features to the Chrome developer tools console. To access the scope of an element selected in the Elements tab of the developer tools, in console, you can type $scope. If you change value of some model on $scope and want to have this change reflected in the running application, you need to call $scope.$apply() after making the change.