Skip to content

Commit eee4981

Browse files
committed
docs(docs): reproduce the form input and separate the fallback lookup
Address the third review of #470: - The form recipe enters the original input again and waits for the form to settle before reading its status, since a code change can reload the page and reset the form. - The missing provider recipe calls a lookup from Root or a parent component a separate lookup that can resolve differently, for example when the failing injection used self, and keeps scan-providers as the lead.
1 parent c31661a commit eee4981

1 file changed

Lines changed: 10 additions & 10 deletions

File tree

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

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -24,16 +24,16 @@ The checkout form won't submit. Use the Pangular tools to find which fields make
2424
invalid and why, fix the cause in the code, then show me the form is valid.
2525
```
2626

27-
| Step | Tool |
28-
| ---------------------------- | ----------------------------------------------------- |
29-
| Keep a marker before the fix | `list-form-changes`, which returns the current marker |
30-
| Find the invalid fields | `explain-invalid-forms` |
31-
| Look at one field | `explain-field` with `form` and `path` |
32-
| See why submit does nothing | `explain-submit` |
33-
| See what the fix changed | `explain-form-changes` with the marker as `after` |
34-
| Prove the form is valid | `inspect-forms` with `form`, for its current status |
27+
| Step | Tool |
28+
| ---------------------------- | ----------------------------------------------------------------------------------------------------- |
29+
| Keep a marker before the fix | `list-form-changes`, which returns the current marker |
30+
| Find the invalid fields | `explain-invalid-forms` |
31+
| Look at one field | `explain-field` with `form` and `path` |
32+
| See why submit does nothing | `explain-submit` |
33+
| See what the fix changed | `explain-form-changes` with the marker as `after` |
34+
| Prove the form is valid | Enter the original input again, `wait-for` with `condition: "form"`, then `inspect-forms` with `form` |
3535

36-
Check that the answer names the failing validator and its message for each field, not only that the form is invalid. Values that look secret stay redacted. See [Forms](./tools.md#forms).
36+
A code change can reload the page and reset the form, so enter the same input as before the fix, wait until the form is settled, and only then read its status. Check that the answer names the failing validator and its message for each field, not only that the form is invalid. Values that look secret stay redacted. See [Forms](./tools.md#forms).
3737

3838
## Explain a failed navigation
3939

@@ -64,7 +64,7 @@ Angular looked for it and why no injector provided it, then fix the providers.
6464
| Walk the lookup path | `explain-injection` with the owner as `injector` and the token |
6565
| Read the providers at a level | `inspect-providers` |
6666

67-
`explain-error` adds the missing provider explainer, and its owner id works as the `injector` of `explain-injection`. If it says **Component: not found**, for example when a routed component fails before it is in the tree, `explain-injection` has no injector to start from and answers **No injector on page**. Read the stack of the error for the class that injects the token, then call `scan-providers` to see where the source provides the token. A live lookup from an injector that is on the page, such as the parent route's component or `Root`, shows only part of the path. When an owner is found, check that the answer marks each injector on the path as **provides it**, **not provided** or **hidden**. See [explain-injection](./tools.md#explain-injection).
67+
`explain-error` adds the missing provider explainer, and its owner id works as the `injector` of `explain-injection`. If it says **Component: not found**, for example when a routed component fails before it is in the tree, `explain-injection` has no injector to start from and answers **No injector on page**. Read the stack of the error for the class that injects the token, then call `scan-providers` to see where the source provides the token. A lookup from an injector that is on the page, such as the parent route's component or `Root`, is a separate lookup, not part of the failing one: it can resolve differently, for example when the failing injection used `self`. When an owner is found, check that the answer marks each injector on the path as **provides it**, **not provided** or **hidden**. See [explain-injection](./tools.md#explain-injection).
6868

6969
## Find wasted change detection
7070

0 commit comments

Comments
 (0)