AngularJS WebInspector Extension for Chrome
You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This repo is archived. You can view files and clone it, but cannot push or open issues/pull-requests.
 
 
 
 
Go to file
Erin Altenhof-Long 6a0ae94f4d fix(loader): create custom loader that is compatible with angular 1.2 and 1.3
A breaking change with the loading of config blocks between angular 1.2 and 1.3 causes
a an error when registering providers if the appropriate version of angular loader is not
used. This custom loader alters the invokeQueue to use config blocks correctly for both
versions of angular. See the issue with the loader and angular docs:
https://github.com/angular/angular-hint/issues/39 And the breaking change for the
angular loader: c0b4e2db9c
10 years ago
bower_components feat(*): set up UI 10 years ago
dist feat(*): implement connection between content script and devTools pane 10 years ago
js feat(*): implement connection between content script and devTools pane 10 years ago
.gitignore chore(.gitignore): ignore built files and dependencies 10 years ago
HintCtrl.js fix(defaultPane): change default console pane to "All" 10 years ago
LICENSE added license 12 years ago
README.md docs: add new build script 10 years ago
app.css feat(*): set up UI 10 years ago
background.js fix(reload): refresh messages on reload of inspectedWindow 10 years ago
bower.json feat(*): set up UI 10 years ago
devtoolsBackground.html feat(*): set up UI 10 years ago
gulpfile.js feat(*): implement connection between content script and devTools pane 10 years ago
hint.html chore(hint.html): change ng-bind to ng-show 10 years ago
hint.js fix(loader): create custom loader that is compatible with angular 1.2 and 1.3 10 years ago
inject.js feat(*): implement connection between content script and devTools pane 10 years ago
loader.js fix(loader): create custom loader that is compatible with angular 1.2 and 1.3 10 years ago
manifest.json feat(*): implement connection between content script and devTools pane 10 years ago
package.json feat(*): implement connection between content script and devTools pane 10 years ago

README.md

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. Install the bower dependencies: bower install
  3. Build the inject script: npm run build
  4. Navigate to chrome://chrome/extensions/ and enable Developer Mode.
  5. Choose "Load unpacked extension"
  6. In the dialog, open the directory you just cloned.

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 the AngularJS Batarang.

In order to begin using the Batarang you need to click the "enable" checkbox. This will cause the application's tab to refresh, and the Batarang to begin collecting perfomance and debug information about the inspected app.

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

Models

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.

Dependencies

Batarang dependencies tab screenshot

The dependencies tab shows a visualization of the application's dependencies. When you hover over a service name, services that depend on the hovered service turn green, and those the hovered service depend on turn red.

Options

Batarang options tab screenshot

Last, there is the options tab. The options tab has three checkboxes: one for "show applications," "show scopes," and "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, and applications a green 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.