2

I don't know the scenarios where I should unsubscribe from route.params observable.

  • Angular docs says we don't need to unsubscribe.

So what is the use cases where I should unsubscribe?

Wale Max
  • 45
  • 4

1 Answers1

2

As per this answer, you should not subscribe except for being a dynamic or a child component:

Unsubscribe from the ActivatedRoute observables like route.params if they are subscribed inside a nested (Added inside tpl with the component selector) or dynamic component as they may be subscribed many times as long as the parent/host component exists. No need to unsubscribe from them in other scenarios as mentioned in the quote above from Routing & Navigation docs.

DevOP
  • 66
  • 4