angular/packages/core
arturovt 5f7f04634f fix(core): call DestroyRef on destroy callback if view is destroyed (#58008)
In this commit, we introduce the ability to check whether `lView` has already been
destroyed in `NodeInjectorDestroyRef`. If the `lView` is already destroyed, we call
the on-destroy callback immediately, without trying to register it to be called later.
This ensures that any necessary cleanup is handled gracefully and provides better
reliability in managing resources.

One of the use cases is `takeUntilDestroyed`, which aims to replace `takeUntil` in existing
applications. While `takeUntil` can be safely called once the view is destroyed—resulting
in no errors and finalizing the subscription depending on whether a subject or replay
subject is used—replacing it with `takeUntilDestroyed` introduces a breaking change, as
it throws an error if the `lView` is destroyed.

Related issue: #54527

PR Close #58008
2025-04-02 15:24:48 +00:00
..
global refactor(docs-infra): use interpolation instead of innerHTML for better perf (#58913) 2024-11-27 10:59:18 +01:00
primitives feat(core): export signalGetFn from signal primitives (#60497) 2025-03-31 22:24:21 +00:00
rxjs-interop fix(core): call DestroyRef on destroy callback if view is destroyed (#58008) 2025-04-02 15:24:48 +00:00
schematics fix(core): fixes #592882 ng generate @angular/core:signal-queries-migration (#60688) 2025-04-02 15:14:43 +00:00
src fix(core): call DestroyRef on destroy callback if view is destroyed (#58008) 2025-04-02 15:24:48 +00:00
test fix(core): call DestroyRef on destroy callback if view is destroyed (#58008) 2025-04-02 15:24:48 +00:00
testing refactor(core): convert scripts within packages/core/testing to relative imports (#60232) 2025-03-27 18:29:35 +00:00
BUILD.bazel refactor(core): Move getCurrentInjector/setCurrentInjector to primitives package. (#60090) 2025-02-28 18:47:08 +00:00
index.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00
package.json feat(core): update Node.js version support (#60545) 2025-03-26 20:42:16 -07:00
PACKAGE.md
public_api.ts refactor: update license text to point to angular.dev (#57901) 2024-09-24 15:33:00 +02:00