Q. Which lifecycle hook is used to clean up subscriptions and detach event handlers before a component is destroyed?
β
Correct Answer: (A)
ngOnDestroy
Explanation: ngOnDestroy is called just before the component is destroyed to perform cleanup.