mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
docs: add inspecting injector section in devtools (#55764)
PR Close #55764
This commit is contained in:
parent
5f3742de6c
commit
179c678e6b
4 changed files with 24 additions and 0 deletions
Binary file not shown.
|
After Width: | Height: | Size: 311 KiB |
Binary file not shown.
|
After Width: | Height: | Size: 260 KiB |
BIN
adev/src/assets/images/guide/devtools/di-injector-tree.png
Normal file
BIN
adev/src/assets/images/guide/devtools/di-injector-tree.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 211 KiB |
|
|
@ -170,3 +170,27 @@ Click the **Save Profile** button at the top-right of a recorded profiling sessi
|
|||
Later, import the file in the initial view of the profiler by clicking the **Choose file** input.
|
||||
|
||||
<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.">
|
||||
|
||||
## Inspect your injectors
|
||||
|
||||
Note: The Injector Tree is available for Angular Applications built with version 17 or higher.
|
||||
|
||||
### View the injector hierarchy of your application
|
||||
|
||||
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.
|
||||
|
||||
<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.">
|
||||
|
||||
### Visualize resolution paths
|
||||
|
||||
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.
|
||||
|
||||
See [resolution rules](guide/di/hierarchical-dependency-injection#resolution-rules) for more details about how Angular resolves resolution paths.
|
||||
|
||||
<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.">
|
||||
|
||||
### View injector providers
|
||||
|
||||
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.
|
||||
|
||||
<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.">
|
||||
|
|
|
|||
Loading…
Reference in a new issue