CodeZettaInterview Hub

Angular · HTTP · Mid-Level · Best Practice

Why should you not subscribe in services just to store data?

Short Interview Answer

Prefer returning Observables/signals to callers; services that subscribe hide cancellation and create leaks.

Detailed Explanation

Expose cold Observables or signal stores updated intentionally. Let components/async pipe manage subscription lifetime.

Did you know this answer?