A

Admin • 832.27K Points
Coach

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
  • Correct Answer - Option(A)
  • Views: 21
  • Filed under category Angular JS
  • Hashtags:

Explanation by: Admin

RouteReuseStrategy allows caching and reusing components between routes.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.