πŸ“Š Angular
Q. What happens when a component is destroyed in Angular?
  • (A) View is hidden but logic continues
  • (B) ngOnDestroy is called and subscriptions should be cleaned up
  • (C) Nothing happens by default
  • (D) Only the DOM is cleared
πŸ’¬ Discuss
βœ… Correct Answer: (B) ngOnDestroy is called and subscriptions should be cleaned up

Explanation: ngOnDestroy is the hook where cleanup tasks like unsubscribing are done.

Explanation by: Mr. Dubey
ngOnDestroy is the hook where cleanup tasks like unsubscribing are done.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
59
Total Visits
πŸ“½οΈ
11 mo ago
Published
πŸŽ–οΈ
Mr. Dubey
Publisher
πŸ“ˆ
93%
Success Rate