Sample Code:
Note:
- We need to do unsubscribe for all subscription, for the observable that we create in project. But for angular’s observable, e.g. ActivatedRoute.params, we do not need to do the clean up, and let Angular do the clean up work.
- Further more, an observable that is completed or error, we do not need to clean up it.