Skip to content

Commit 0381ac5

Browse files
committed
docs(injectors): say when read-provider-value needs tokenId
1 parent 112730a commit 0381ac5

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

‎apps/docs/src/content/agents/tools.md‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -507,7 +507,7 @@ An element injector that belongs to a component carries `componentId`, the insta
507507

508508
Without `injector` or `token`, the answer is the whole tree and says which change detection mode the page runs. The answer stays within 20,000 characters and its JSON always parses. A larger tree shows element injectors as an outline (id, name, type, component, and provider and dependency counts), and when that is still too long it leaves out the deepest injectors and says how many. The environment injectors are always there, as an outline when they are large, and without their deepest injectors when even that outline is too long. An `injector` or `token` answer that is too long cuts each injector's `providers` and `dependencies` lists, with `providersTotal` and `dependenciesTotal` giving the full counts, so a large injector such as `Root` still shows. An `@ngrx/signals` store that an environment injector created carries the name the NgRx tools use, such as `TravelStore`, in `token`, and its class name `SignalStore` in `tokenClass`; `token` finds it by either name, and so do `read-provider-value` and `explain-injection`. `injector` and `token` take at most 500 characters each.
509509

510-
Each provider and dependency carries `tokenId`, the page's id for the token object, so two tokens with the same name, such as two `new InjectionToken('config')`, stay apart. A `token` that several tokens share lists every match with its `tokenId`, and `tokenId` keeps one of them. `read-provider-value` and `explain-injection` answer such a name with the candidates instead, and take `tokenId` to pick one. Ids last until the page reloads. A tree from an older overlay has no ids, and the tools match by name.
510+
Each provider and dependency carries `tokenId`, the page's id for the token object, so two tokens with the same name, such as two `new InjectionToken('config')`, stay apart. A `token` that several tokens share lists every match with its `tokenId`, and `tokenId` keeps one of them. `read-provider-value` and `explain-injection` answer such a name with the candidates instead, and take `tokenId` to pick one. `read-provider-value` needs no `tokenId` when its `injector` leaves only one token with the name. Ids last until the page reloads. A tree from an older overlay has no ids, and the tools match by name.
511511

512512
When the page reported only part of its injector tree (it keeps at most 2000 element injectors and 2500 in all, and leaves out injectors nested more than 1000 levels deep), the answer says so.
513513

@@ -518,7 +518,7 @@ The current value of a service or other provider that an injector on the page al
518518
| Argument | Required | Value |
519519
| ---------- | -------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
520520
| `token` | yes | A class name like `CartStore` or an `InjectionToken` description like `API_URL`. |
521-
| `tokenId` | no | The id of one token, like `tok-3`. Needed when several tokens share the name; the answer then lists them. |
521+
| `tokenId` | no | The id of one token, like `tok-3`. Needed when several tokens share the name and `injector` doesn't narrow them to one; the answer then lists them. |
522522
| `injector` | no | An injector id, `Root`, `Platform`, `Route: admin`, a tag or a component class name. Defaults to the first injector that provides the token, environment injectors first. |
523523
| `path` | no | A member, then keys or indexes, like `items` or `cart.items[0]`. Without it, the answer lists the members. |
524524
| `depth` | no | With `path`, the levels to read below it, 1 to 5. |

0 commit comments

Comments
 (0)