Sub topic 2
Installing the extension and meeting its requirements
Angular DevTools is a browser extension. It does nothing until three conditions hold: the browser supports it, the Angular version is compatible, and the app is running in development mode. Most "the Angular tab is missing" problems come from one of these. This chapter covers each one and shows how to check it.
This chapter assumes you can start an Angular app with the CLI, you know what the ng serve and ng build commands do, and you have used the Elements and Console panels of your browser's developer tools.
What you are installing
The extension adds an Angular tab to the browser's developer tools. It has two main parts. The component explorer shows the component tree and component state. The profiler records change detection. Later chapters cover both. This chapter only gets the extension working.
The extension has three pieces:
- A content script that runs inside the page and looks for an Angular application.
- A backend that runs in the page and reads Angular's debug APIs, the same ones behind the
ngglobal in the console. - The DevTools panel, which displays the data and sends commands back.
Because the backend relies on debug APIs, the extension can only show what Angular exposes. If those APIs are missing, there is nothing to show.
Supported browsers
Angular DevTools is published for Chromium-based browsers and for Firefox.
| Browser | Where to get it | Notes |
|---|---|---|
| Google Chrome | Chrome Web Store | The reference browser for the extension. |
| Microsoft Edge | Chrome Web Store | Edge installs Chrome extensions. |
| Other Chromium browsers | Chrome Web Store | Brave, Opera and similar usually work. Check the store listing if you hit problems. |
| Mozilla Firefox | Firefox Add-ons | Published as a separate listing. |
Search for "Angular DevTools" and check that the publisher is the Angular team. Several unrelated extensions have similar names.
Safari is not on this list. If your bug only appears in Safari, you can still debug it in Chrome or Firefox when it reproduces there. If it doesn't reproduce there, you will need Safari's own Web Inspector.
Angular version requirements
The extension supports applications that use Angular 12 or later and are compiled with Ivy, Angular's rendering engine. Ivy has been the only engine since Angular 13, so for any maintained project this requirement is met automatically. Only an old project stuck on Angular 11 or earlier, or one with Ivy disabled, will fail it.
The extension keeps working across newer versions, but some features depend on the Angular version. If a panel feature seems to be missing, upgrade Angular before assuming a bug. Signal-related views are a typical example. They need an Angular release that has signals.
The development mode requirement
Angular DevTools works only with an application running in development mode. This is the most common cause of confusion.
Angular ships debugging hooks in development builds. Production builds drop them, because they add code and slow things down. Production builds also minify names, so a component class like ReportComponent would appear as something like a in the tree. The extension therefore has no reliable data to read.
You get a development-mode app from:
ng serve, which uses the development configuration by default.ng build --configuration development, if you serve the output with your own static server.
You get a production-mode app from ng build with the production configuration, which is the default for ng build in current CLI versions. You also get one if code calls enableProdMode().
Be careful with that last case. An app can be built in development configuration and still run in production mode if main.ts calls enableProdMode() unconditionally. Modern Angular does not require this call, but older projects often have it:
import { enableProdMode, isDevMode } from '@angular/core';
import { bootstrapApplication } from '@angular/platform-browser';
import { AppComponent } from './app/app.component';
// Only switch to production mode when the build is not a development build.
// A bare enableProdMode() call would hide the app from Angular DevTools.
if (!isDevMode()) {
enableProdMode();
}
bootstrapApplication(AppComponent).catch((err) => console.error(err));isDevMode() returns true in development builds, so this guard is safe. If you find an unguarded enableProdMode() in a project you are debugging, that is probably why the extension reports production mode.
Installing and opening the extension
- Open the extension listing for your browser and choose Add to Chrome, Add to Firefox, or the equivalent for your browser.
- Confirm the permission prompt. The extension asks to read and change data on web pages so that it can detect Angular. You can restrict this later in your browser's extension settings.
- Start your app, for example with
ng serve, and open it, usually athttp://localhost:4200. - Open the browser's developer tools. Use F12, or Ctrl+Shift+I on Windows and Linux, or Cmd+Option+I on macOS.
- Select the Angular tab. It may sit behind the
>>overflow menu if the tab bar is crowded.
If you installed the extension while the page was already open, reload the page. The content script loads when the page loads, so an already-open page can't use it until then.
Checking what the extension detected
The extension's toolbar icon shows its detection result. Click it to see a small popup. The messages vary slightly between versions, but they fall into these cases:
| What you see | Meaning | What to do |
|---|---|---|
| Angular tab with the component tree | Angular detected in development mode | Continue. |
| Popup says the page is in production mode | Angular found, debug hooks absent | Run a development build. Check `main.ts` for an unguarded `enableProdMode()`. |
| Popup says no Angular detected | No Angular root element found | Check the page, the frame, and whether the app has bootstrapped. |
| Popup says the Angular version is unsupported | Version below 12 or no Ivy | Upgrade Angular, or debug another way. |
| No Angular tab at all | Extension not loaded in this tab | Reload the page. Reopen developer tools. Check that the extension is enabled. |
The following diagram shows the same checks as a decision path.
Verifying from the console
When the extension's message is unclear, the console gives an independent check. Angular sets an ng-version attribute on each root element, in both development and production builds. Development builds additionally expose the ng global.
// Run in the browser console on the page you are debugging.
// 1. Is there an Angular root element, and which version?
const root = document.querySelector('[ng-version]');
console.log('Angular version:', root ? root.getAttribute('ng-version') : 'not found');
// 2. Are the development-mode debug APIs present?
console.log('Debug APIs available:', typeof ng !== 'undefined');Read the two results together:
- Version found and
Debug APIs available: true: the app is in development mode, and the extension should work. - Version found and
Debug APIs available: false: Angular is there but in production mode. - Version not found: no Angular root exists in this frame. See the next section.
Pages where detection fails despite a correct setup
These cases trip people up even when the app is in development mode.
The app is inside an iframe. Developer tools inspect one frame at a time, and a content script in the top page does not see Angular running in a child frame. Recent versions of the extension can list frames and let you pick one. If yours does not, open the iframe's URL in its own tab.
The app has not bootstrapped yet. If the root element has no ng-version attribute, bootstrap has not completed or has failed. Look in the console for errors from main.ts, such as a missing provider. Fix those first.
Local files and private windows. Browsers restrict extensions on file:// pages and in private or incognito windows unless you allow them in the extension settings. Serve the app over http://localhost instead of opening index.html directly.
Multiple Angular apps on one page. A page can contain several Angular roots, such as micro-frontends. Each root shows in the tree, and each must be in development mode. One root bootstrapped with a production-mode copy of Angular will not appear.
A restrictive Content Security Policy. The backend runs inside the page. If your CSP is unusually strict, or you embed the app in a host page that controls it, injection may be blocked. Test against a plain ng serve build to rule this out.
A quick smoke test
After installing, confirm the whole chain with a short sequence:
- Run
ng serveand open the app. - In the console, run the two-line check above and confirm both results.
- Open the Angular tab and confirm the root component appears in the component tree.
- Click a component in the tree. The right-hand pane should show its properties.
If step 4 works, you are ready for the next chapter, which starts exploring the tree. If any step fails, use the decision diagram above to find which requirement is not met.
Exercise
You install Angular DevTools in Chrome and open your team's app, built with ng build --configuration development and served from a static server. The extension still says the app is in production mode. The console check shows ng-version is present but typeof ng is 'undefined'. What is the most likely cause, and how do you confirm and fix it?
Show answer
Something is still switching Angular into production mode at runtime, most likely an unguarded enableProdMode() call in main.ts. The ng-version result shows Angular is present, and the missing ng global shows the debug APIs were not enabled. Confirm by searching the source for enableProdMode. Fix it by wrapping the call in if (!isDevMode()) { ... } or removing it, rebuild with the development configuration, and reload the page.
Exercise
A colleague opens the production URL of your app and reports that Angular DevTools shows no component tree. They ask you to file a bug against the extension. What do you tell them?
Show answer
This is expected behavior, not a bug. Angular DevTools only works with development-mode builds because production builds remove the debug hooks and minify names. To investigate, reproduce the problem locally with ng serve. If it only happens in the optimized build, use source maps and the browser's own tools.