Skip to content

Commit 179c678

Browse files
sasidharansdatscott
authored andcommitted
docs: add inspecting injector section in devtools (angular#55764)
PR Close angular#55764
1 parent 5f3742d commit 179c678

File tree

4 files changed

+24
-0
lines changed

4 files changed

+24
-0
lines changed
311 KB
Loading
260 KB
Loading
211 KB
Loading

adev/src/content/tools/devtools.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -170,3 +170,27 @@ Click the **Save Profile** button at the top-right of a recorded profiling sessi
170170
Later, import the file in the initial view of the profiler by clicking the **Choose file** input.
171171

172172
<img src="assets/images/guide/devtools/save-profile.png" alt="A screenshot of the 'Profiler' tab displaying change detection cycles. On the right side a 'Save Profile' button is visible.">
173+
174+
## Inspect your injectors
175+
176+
Note: The Injector Tree is available for Angular Applications built with version 17 or higher.
177+
178+
### View the injector hierarchy of your application
179+
180+
The **Injector Tree** tab lets you explore the structure of the Injectors configured in your application. Here you will see two trees representing the [injector hierarchy](guide/di/hierarchical-dependency-injection) of your application. One tree is your environment hierarchy, the other is your element hierarchy.
181+
182+
<img src="assets/images/guide/devtools/di-injector-tree.png" alt="A screenshot of the 'Profiler' tab displaying the injector tree tab in Angular Devtools visualizing the injector graph for an example application.">
183+
184+
### Visualize resolution paths
185+
186+
When a specific injector is selected, the path that Angular's dependency injection algorithm traverses from that injector to the root is highlighted. For element injectors, this includes highlighting the environment injectors that the dependency injection algorithm jumps to when a dependency cannot be resolved in the element hierarchy.
187+
188+
See [resolution rules](guide/di/hierarchical-dependency-injection#resolution-rules) for more details about how Angular resolves resolution paths.
189+
190+
<img src="assets/images/guide/devtools/di-injector-tree-selected.png" alt="A screenshot of the 'Profiler' tab displaying how the injector tree visualize highlights resolution paths when an injector is selected.">
191+
192+
### View injector providers
193+
194+
Clicking an injector that has configured providers will display those providers in a list on the right of the injector tree view. Here you can view the provided token and it's type.
195+
196+
<img src="assets/images/guide/devtools/di-injector-tree-providers.png" alt="A screenshot of the 'Profiler' tab displaying how providers are made visible when an injector is selected.">

0 commit comments

Comments
 (0)