πŸ“Š Angular
Q. How do you prevent a component from being destroyed when navigating away in Angular?
  • (A) Use RouteReuseStrategy
  • (B) Implement OnDestroy and skip cleanup
  • (C) Use ngOnDestroy lifecycle hook
  • (D) Use @ViewChild decorator
πŸ’¬ Discuss
βœ… Correct Answer: (A) Use RouteReuseStrategy

Explanation: RouteReuseStrategy allows caching and reusing components between routes.

Explanation by: Mr. Dubey
RouteReuseStrategy allows caching and reusing components between routes.

πŸ’¬ Discussion


πŸ“Š Question Analytics

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