mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
Adds a `manualCleanup` flag to `afterRender` and `afterNextRender`, similarly to `effect`. The reason is that currently if the hook is created outside of an injection context, it requires an injector to be passed in. In some cases that injector might be an injector that is never destroyed (e.g. `EnvironmentInjector`) which can give a false sense of security users thinking that the hook will be cleaned up automatically. We fell into this in the CDK which caused a memory leak (see https://github.com/angular/components/pull/29709). With the `manualCleanup` option users explicitly opt into cleaning the hook up themselves. PR Close #57917 |
||
|---|---|---|
| .. | ||
| primitives | ||
| rxjs-interop | ||
| testing | ||
| errors.api.md | ||
| global_utils.api.md | ||
| index.api.md | ||