Commit d40aba1
committed
docs(zones): show how to keep AngularFire calls in an injection context
The zone-wrappers guide explains what the "outside of an Injection context" warning means and how to change its log level, but never shows how to fix the code that triggers it. #3629 asks for exactly that.
This adds a "Keeping calls inside an injection context" section covering the most common trigger: an AngularFire API called inside an async callback (for example a Firestore query built inside a switchMap on the signed-in user), where the callback runs after the synchronous injection context is gone. The recipe captures an EnvironmentInjector while the context is active and re-establishes it inside the callback with runInInjectionContext, plus a note to prefer hoisting the call out of the callback when it doesn't depend on the async value.
Docs-only; no code or behavior change.
Fixes #36291 parent 8dfcc2c commit d40aba1
1 file changed
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
21 | 52 | | |
22 | 53 | | |
23 | 54 | | |
| |||
0 commit comments