What is a common cause of a memory leak in an Angular component?
- A Using the async pipe
- B Subscribing to a long-lived observable without unsubscribing
- C Using OnPush change detection
- D Declaring too many inputs
Answer
Subscribing to a long-lived observable without unsubscribing
Router events, form valueChanges, intervals and root service subjects never complete on their own, so the subscription keeps the component alive.





