Angular 16 Preview: TakeUntilDestroyed

Angular 16 will be released next week, and this new version will be big. I will cover most of the new features of Angular 16 for the next few days.

One of the simple but handy features shipped with Angular 16 is a newoperator for RxJs Observables:takeUntilDestroyed.

We have covered several techniques toautomatically unsubscribe from Observablesin this newsletter.

takeUntilDestroyedwill make all of it easier than ever:

And that’s it! That one operator will take care of automatically unsubscribing fromdata$when the component/pipe/directive using it is destroyed.

Signalswill be the most significant addition to Angular 16 (as a developer preview – for now), and as a result, I’m about to launch a short course on Signals. If you’re interested in beta-testing that course (for free!), please respond to this email to let me know.


Alain is a Google Developer Expert in Web Technologies, Angular, and Google Maps. His daily mission is to help development teams adopt Angular and build at scale with the framework. He has taught Angular on all six continents! A world traveler and photographer, Alain is also an international conference speaker, and a published author of several video courses.