
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.

Accessible Vue Apps
Build more accessible Vue apps with practical guidance on semantic HTML, ARIA bindings, focus management, accessible routing, keyboard navigation, and common mistakes to avoid.
Reza Baar
Mar 31, 2026

Building a Full-Stack app with Nuxt and the Supabase MCP
Advanced Agentic AI & Nuxt: MCP setup, schema design, policies, server routes and the full-stack agentic workflow recap with code examples
Reza Baar
Mar 26, 2026

AI Coding in React: What You Still Need to Know
AI tools like Cursor and Copilot make React development faster, but your React knowledge determines how good the output is. Here's what you need to know.
Aurora Scharff
Mar 24, 2026
We can help you recruit Certified Developers for your organization or project. The team has helped many customers employ suitable resources from a pool of 100s of qualified Developers.
Let us help you get the resources you need.
