Angular: Automatically Unsubscribe Observables on Destroy

Опубликовано: 30 Июль 2026
на канале: Lucas Paganini
23,378
156

How to subscribe to something and tell Angular to automatically unsubscribe when the component (or directive) is destroyed.

📚 Read the article: https://www.lucaspaganini.com/academy...
🚨 Subscribe to the newsletter: https://www.lucaspaganini.com/newsletter

📧 Email: [email protected]
🐦 Twitter:   / lucaspaganini  
📸 Instagram:   / lucaspaganini  

----------

CHAPTERS
0:00 Introduction
0:29 Inspiration
0:40 Service per Component
1:03 Until the Service Destroys
1:27 Conclusion

REFERENCES:
1. Library - (npm): https://www.npmjs.com/package/@lucasp...
2. Repository - (Github Repository): https://github.com/LucasPaganini/angu...