
This article explains how Angular 16 improves observable cleanup using takeUntilDestroyed and recommends applying it in services rather than components, so all subscribers are automatically protected from memory leaks.
Alain Chautard
January 15, 2026
We covered this in our newsletter before: Observables can cause memory leaks if we don’t unsubscribe from them.

Before Angular 16, there were a few different techniques available to unsubscribe automatically, the best of those being the async pipe (and yes, it’s possible to use the async pipe 100% of the time if you use the tricks highlighted here – no excuses).
With Angular 16, things are even better, as you can use the new takeUntilDestroyed operator as follows:

But here’s my million-dollar tip for today: Instead of using takeUntilDestroyed in your components, use it in the services that expose such Observables:

That way, whether you use an async pipe or not, your components are covered. That’s one of the nice things about Observables: We can change them whenever and wherever we want using pipe(), including in our services – so that all subscribers benefit from that change downstream.
Get the latest news and updates on developer certifications. Content is updated regularly, so please make sure to bookmark this page or sign up to get the latest content directly in your inbox.

Component Architecture for React Server Components
React Server Components let each component fetch its own data, so pages compose instead of prop-drilling. How that reshapes architecture, loading boundaries, and UX.
Aurora Scharff
Aug 20, 2026

Background Jobs with Nitro Tasks API
How to run one-off and scheduled background work in Nuxt using Nitro's Tasks API, and what to watch for per deployment platform.
Reza Baar
Aug 19, 2026

What’s new in Angular 22.1?
Angular 22.1 introduces a major change to Angular’s release cycle, moving to one major release per year. Learn what this means for Angular upgrades, versioning, and the future of the framework.
Alain Chautard
Aug 18, 2026