{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/16261","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/16261/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/16261/comments","events_url":"https://api.github.com/repos/angular/angular/issues/16261/events","html_url":"https://github.com/angular/angular/issues/16261","id":223617709,"number":16261,"title":"Router - auto unsubscribe from the params observable is not working","user":{"login":"NetanelBasal","id":6745730,"avatar_url":"https://avatars1.githubusercontent.com/u/6745730?v=4","gravatar_id":"","url":"https://api.github.com/users/NetanelBasal","html_url":"https://github.com/NetanelBasal","followers_url":"https://api.github.com/users/NetanelBasal/followers","following_url":"https://api.github.com/users/NetanelBasal/following{/other_user}","gists_url":"https://api.github.com/users/NetanelBasal/gists{/gist_id}","starred_url":"https://api.github.com/users/NetanelBasal/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/NetanelBasal/subscriptions","organizations_url":"https://api.github.com/users/NetanelBasal/orgs","repos_url":"https://api.github.com/users/NetanelBasal/repos","events_url":"https://api.github.com/users/NetanelBasal/events{/privacy}","received_events_url":"https://api.github.com/users/NetanelBasal/received_events","type":"User","site_admin":false},"labels":[{"id":375500771,"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8","default":false}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":11,"created_at":"2017-04-23T07:06:55Z","updated_at":"2017-12-06T21:23:15Z","closed_at":null,"author_association":"NONE","body":"```\n[ x ] bug report\n```\n\n**Current behavior**\nThis is a quote from the official documentation - \n\n> The subscriptions are cleaned up when the component is destroyed, protecting against memory leaks, so you don't need to unsubscribe from the route params Observable.\n\nThe subscription is still active.\n\n**Expected behavior**\nAngular should unsubscribe from the params observable when the component destroyed. ( or change the documentation )\n\n**Minimal reproduction of the problem with instructions**\nYou can test this behavior with the `delay` operator.\n\n```ts\n@Component({\n ...\n})\nexport class TestComponent implements OnInit {\n  params;\n  constructor(private route: ActivatedRoute) { }\n\n  ngOnInit() {\n    this.params = this.route.params.delay(3000).subscribe(console.log);\n  }\n}\n\n```\n\nWhen navigates to a different route the handler is still running. \n\nYou can verify this by calling explicitly to the `unsubscribe()` method.\n\n```ts\nngOnDestroy() {\n  this.params.unsubscribe();\n}\n```\n\nNow you will see that the handler is not running. \n\n**Angular version:** 4.0.X"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/349779065","html_url":"https://github.com/angular/angular/issues/16261#issuecomment-349779065","issue_url":"https://api.github.com/repos/angular/angular/issues/16261","id":349779065,"user":{"login":"tproenca","id":1155294,"avatar_url":"https://avatars3.githubusercontent.com/u/1155294?v=4","gravatar_id":"","url":"https://api.github.com/users/tproenca","html_url":"https://github.com/tproenca","followers_url":"https://api.github.com/users/tproenca/followers","following_url":"https://api.github.com/users/tproenca/following{/other_user}","gists_url":"https://api.github.com/users/tproenca/gists{/gist_id}","starred_url":"https://api.github.com/users/tproenca/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tproenca/subscriptions","organizations_url":"https://api.github.com/users/tproenca/orgs","repos_url":"https://api.github.com/users/tproenca/repos","events_url":"https://api.github.com/users/tproenca/events{/privacy}","received_events_url":"https://api.github.com/users/tproenca/received_events","type":"User","site_admin":false},"created_at":"2017-12-06T21:23:15Z","updated_at":"2017-12-06T21:23:15Z","author_association":"NONE","body":"The router is not unsubscribing for params or queryParams only when I have more than 1 instance of the same component being rendered in the page."}}
{"actor":{"display_login":"tproenca"}}