Developer Tools
DevTools

Inspect the component tree

Debug your application

The Components tab lets you explore the structure of your application. You can visualize the component and directive instances in the DOM and inspect or modify their state.

Explore the application structure

The component tree displays a hierarchical relationship of the components and directives within your application.

A screenshot of the 'Components' tab showing a tree of Angular components and directives starting the root of the application.

Click the individual components or directives in the component explorer to select them and preview their properties. Angular DevTools displays properties and metadata on the right side of the component tree.

To look up a component or directive by name use the search box above the component tree.

A screenshot of the 'Components' tab. The filter bar immediately underneath the tab is searching for 'todo' and all components with 'todo' in the name are highlighted in the tree. `app-todos` is currently selected and a sidebar to the right displays information about the component's properties. This includes a section of `@Output` fields and another section for other properties.

To go to the host element of a particular component or directive, double-click it in the component explorer. Angular DevTools will open the Elements tab in Chrome or the Inspector tab in Firefox, and select the associated DOM node.

For components, Angular DevTools lets you navigate to the component definition in the Sources tab (Chrome) and Debugger tab (Firefox). After you select a particular component, click the icon at the top-right of the properties view:

A screenshot of the 'Components' tab. The properties view on the right is visible for a component and the mouse rests in the upper right corner of that view on top of a `<>` icon. An adjacent tooltip reads 'Open component source'.

Update property value

Like browsers' DevTools, the properties view lets you edit the value of an input, output, or other properties. Right-click on the property value and if edit functionality is available for this value type, a text input will appear. Type the new value and press Enter to apply this value to the property.

A screenshot of the 'Components' tab with the properties view open for a component. An `@Input` named `todo` contains a `label` property which is currently selected and has been manually updated to the value 'Buy milk'.

Access selected component or directive in console

As a shortcut in the console, Angular DevTools provides access to instances of recently selected components or directives. Type $ng0 to get a reference to the instance of the currently selected component or directive, and type $ng1 for the previously selected instance, $ng2 for the instance selected before that, and so on.

A screenshot of the 'Components' tab with the browser console underneath. In the console, the user has typed three commands, `$ng0`, `$ng1`, and `$ng2` to view the three most recently selected elements. After each statement, the console prints a different component reference.

Select a directive or component

Similar to browsers' DevTools, you can inspect the page to select a particular component or directive. Click the Inspect element icon in the top left corner within Angular DevTools and hover over a DOM element on the page. The extension recognizes the associated directives and/or components and lets you select the corresponding element in the Component tree.

A screenshot of the 'Components' tab with an Angular todo application visible. In the very top-left corner of Angular DevTools, an icon of a screen with a mouse icon inside it is selected. The mouse rests on a todo element in the Angular application UI. The element is highlighted with a `<TodoComponent>` label displayed in an adjacent tooltip.

Inspect Deferrable views

Alongside the directives, the directive tree also includes @defer blocks.

Clicking a defer block shows more details in the properties sidebar: the different optional blocks (for example @loading, @placeholder, and @error), the configured triggers (defer triggers, prefetch triggers, and hydrate triggers), and timing options such as the minimum and after values.

Hydration

When hydration is enabled on your SSR/SSG application, the directive tree shows the hydration status of each component.

In case of errors, an error message is displayed on the affected component.

The hydration status can also be visualized on the application itself by enabling the overlay.

Here is an illustration of the hydration overlays on a Angular e-shop example app.