mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
29e5d509aa
https://github.com/angular/angular/issues/16261#issuecomment-748289240 A couple important things to note about the behavior: * The component is destroyed, meaning that all of its members will be destroyed as well, including any subscriptions to the route params * This _does not_ mean that any `finalize` operators or `complete` on the subscription is called. This only happens if the source completes or you unsubscribe from the subscription. The documentation doesn't state that the `Router` will do this, though I can still understand why the behavior is confusing. You can play around with these scenarios here: https://stackblitz.com/edit/rxjs-hmpizx * `complete` the source without unsubscribe: `next`, `complete` and `finalize` are all called, even when `complete` is called before the `next` from the `delay` * `unsubscribe` from subscription without `complete` on the source: `finalize` happens, but the `complete` of the subscription does not, and neither does `next` So even if the `Router` were to call `complete` on all of the `Observables` on an `ActivatedRoute`, you would see that any subscriptions with a `delay` operator would still get called. resolves #16261 PR Close #42316