{"action":"created","comment":{"url":"https://api.github.com/repos/angular/material/pulls/comments/46376185","id":46376185,"diff_hunk":"@@ -404,6 +404,11 @@ function SidenavController($scope, $element, $attrs, $mdComponentRegistry, $q) {\n   self.close  = function() { return self.$toggleOpen( false ); };\n   self.toggle = function() { return self.$toggleOpen( !$scope.isOpen );  };\n   self.$toggleOpen = function(value) { return $q.when($scope.isOpen = value); };\n+  self.destroy = angular.noop;\n \n-  self.destroy = $mdComponentRegistry.register(self, $attrs.mdComponentId);\n+  $attrs.$observe('mdComponentId', function(id){\n+    self.destroy();\n+\n+    self.destroy = $mdComponentRegistry.register(self, id);","path":"src/components/sidenav/sidenav.js","position":10,"original_position":10,"commit_id":"99744c16588d1928c0e921457c4521dfbfe05a9a","original_commit_id":"99744c16588d1928c0e921457c4521dfbfe05a9a","user":{"login":"ThomasBurleson","id":210413,"avatar_url":"https://avatars.githubusercontent.com/u/210413?v=3","gravatar_id":"","url":"https://api.github.com/users/ThomasBurleson","html_url":"https://github.com/ThomasBurleson","followers_url":"https://api.github.com/users/ThomasBurleson/followers","following_url":"https://api.github.com/users/ThomasBurleson/following{/other_user}","gists_url":"https://api.github.com/users/ThomasBurleson/gists{/gist_id}","starred_url":"https://api.github.com/users/ThomasBurleson/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ThomasBurleson/subscriptions","organizations_url":"https://api.github.com/users/ThomasBurleson/orgs","repos_url":"https://api.github.com/users/ThomasBurleson/repos","events_url":"https://api.github.com/users/ThomasBurleson/events{/privacy}","received_events_url":"https://api.github.com/users/ThomasBurleson/received_events","type":"User","site_admin":false},"body":"This is not a `destroyFn`... rather it is a `unRegister()` function. \r\nLet's adjust the code accordingly.","created_at":"2015-12-02T04:24:59Z","updated_at":"2015-12-02T04:24:59Z","html_url":"https://github.com/angular/material/pull/5972#discussion_r46376185","pull_request_url":"https://api.github.com/repos/angular/material/pulls/5972","_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/comments/46376185"},"html":{"href":"https://github.com/angular/material/pull/5972#discussion_r46376185"},"pull_request":{"href":"https://api.github.com/repos/angular/material/pulls/5972"}}},"pull_request":{"url":"https://api.github.com/repos/angular/material/pulls/5972","id":52049851,"html_url":"https://github.com/angular/material/pull/5972","diff_url":"https://github.com/angular/material/pull/5972.diff","patch_url":"https://github.com/angular/material/pull/5972.patch","issue_url":"https://api.github.com/repos/angular/material/issues/5972","number":5972,"state":"open","locked":false,"title":"feat(sidenav): observe component id change","user":{"login":"EladBezalel","id":6004537,"avatar_url":"https://avatars.githubusercontent.com/u/6004537?v=3","gravatar_id":"","url":"https://api.github.com/users/EladBezalel","html_url":"https://github.com/EladBezalel","followers_url":"https://api.github.com/users/EladBezalel/followers","following_url":"https://api.github.com/users/EladBezalel/following{/other_user}","gists_url":"https://api.github.com/users/EladBezalel/gists{/gist_id}","starred_url":"https://api.github.com/users/EladBezalel/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/EladBezalel/subscriptions","organizations_url":"https://api.github.com/users/EladBezalel/orgs","repos_url":"https://api.github.com/users/EladBezalel/repos","events_url":"https://api.github.com/users/EladBezalel/events{/privacy}","received_events_url":"https://api.github.com/users/EladBezalel/received_events","type":"User","site_admin":false},"body":"Sidenav was registering the first interpolated component id.\r\nNow observing the component id attribute changes, removing the old registration and registering with the new interpolated value.\r\n\r\nfixes #4987 and #3171","created_at":"2015-11-28T22:29:03Z","updated_at":"2015-12-02T04:24:59Z","closed_at":null,"merged_at":null,"merge_commit_sha":"1cbf04c75e25ea288b6c6f53ac4be6b19e1be52e","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/angular/material/pulls/5972/commits","review_comments_url":"https://api.github.com/repos/angular/material/pulls/5972/comments","review_comment_url":"https://api.github.com/repos/angular/material/pulls/comments{/number}","comments_url":"https://api.github.com/repos/angular/material/issues/5972/comments","statuses_url":"https://api.github.com/repos/angular/material/statuses/99744c16588d1928c0e921457c4521dfbfe05a9a","head":{"label":"angular:feat/sidenav-observe-component-id","ref":"feat/sidenav-observe-component-id","sha":"99744c16588d1928c0e921457c4521dfbfe05a9a","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":21399598,"name":"material","full_name":"angular/material","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material","description":"Material design for Angular","fork":false,"url":"https://api.github.com/repos/angular/material","forks_url":"https://api.github.com/repos/angular/material/forks","keys_url":"https://api.github.com/repos/angular/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material/teams","hooks_url":"https://api.github.com/repos/angular/material/hooks","issue_events_url":"https://api.github.com/repos/angular/material/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material/events","assignees_url":"https://api.github.com/repos/angular/material/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material/tags","blobs_url":"https://api.github.com/repos/angular/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material/languages","stargazers_url":"https://api.github.com/repos/angular/material/stargazers","contributors_url":"https://api.github.com/repos/angular/material/contributors","subscribers_url":"https://api.github.com/repos/angular/material/subscribers","subscription_url":"https://api.github.com/repos/angular/material/subscription","commits_url":"https://api.github.com/repos/angular/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material/merges","archive_url":"https://api.github.com/repos/angular/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material/downloads","issues_url":"https://api.github.com/repos/angular/material/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material/labels{/name}","releases_url":"https://api.github.com/repos/angular/material/releases{/id}","created_at":"2014-07-01T19:20:06Z","updated_at":"2015-12-02T03:22:47Z","pushed_at":"2015-12-02T03:51:04Z","git_url":"git://github.com/angular/material.git","ssh_url":"git@github.com:angular/material.git","clone_url":"https://github.com/angular/material.git","svn_url":"https://github.com/angular/material","homepage":"https://material.angularjs.org/","size":62320,"stargazers_count":11420,"watchers_count":11420,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2106,"mirror_url":null,"open_issues_count":1308,"forks":2106,"open_issues":1308,"watchers":11420,"default_branch":"master"}},"base":{"label":"angular:master","ref":"master","sha":"3d65dea8003375ec41cf4ff5be6f1376b85f5a71","user":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"repo":{"id":21399598,"name":"material","full_name":"angular/material","owner":{"login":"angular","id":139426,"avatar_url":"https://avatars.githubusercontent.com/u/139426?v=3","gravatar_id":"","url":"https://api.github.com/users/angular","html_url":"https://github.com/angular","followers_url":"https://api.github.com/users/angular/followers","following_url":"https://api.github.com/users/angular/following{/other_user}","gists_url":"https://api.github.com/users/angular/gists{/gist_id}","starred_url":"https://api.github.com/users/angular/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/angular/subscriptions","organizations_url":"https://api.github.com/users/angular/orgs","repos_url":"https://api.github.com/users/angular/repos","events_url":"https://api.github.com/users/angular/events{/privacy}","received_events_url":"https://api.github.com/users/angular/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/angular/material","description":"Material design for Angular","fork":false,"url":"https://api.github.com/repos/angular/material","forks_url":"https://api.github.com/repos/angular/material/forks","keys_url":"https://api.github.com/repos/angular/material/keys{/key_id}","collaborators_url":"https://api.github.com/repos/angular/material/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/angular/material/teams","hooks_url":"https://api.github.com/repos/angular/material/hooks","issue_events_url":"https://api.github.com/repos/angular/material/issues/events{/number}","events_url":"https://api.github.com/repos/angular/material/events","assignees_url":"https://api.github.com/repos/angular/material/assignees{/user}","branches_url":"https://api.github.com/repos/angular/material/branches{/branch}","tags_url":"https://api.github.com/repos/angular/material/tags","blobs_url":"https://api.github.com/repos/angular/material/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/angular/material/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/angular/material/git/refs{/sha}","trees_url":"https://api.github.com/repos/angular/material/git/trees{/sha}","statuses_url":"https://api.github.com/repos/angular/material/statuses/{sha}","languages_url":"https://api.github.com/repos/angular/material/languages","stargazers_url":"https://api.github.com/repos/angular/material/stargazers","contributors_url":"https://api.github.com/repos/angular/material/contributors","subscribers_url":"https://api.github.com/repos/angular/material/subscribers","subscription_url":"https://api.github.com/repos/angular/material/subscription","commits_url":"https://api.github.com/repos/angular/material/commits{/sha}","git_commits_url":"https://api.github.com/repos/angular/material/git/commits{/sha}","comments_url":"https://api.github.com/repos/angular/material/comments{/number}","issue_comment_url":"https://api.github.com/repos/angular/material/issues/comments{/number}","contents_url":"https://api.github.com/repos/angular/material/contents/{+path}","compare_url":"https://api.github.com/repos/angular/material/compare/{base}...{head}","merges_url":"https://api.github.com/repos/angular/material/merges","archive_url":"https://api.github.com/repos/angular/material/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/angular/material/downloads","issues_url":"https://api.github.com/repos/angular/material/issues{/number}","pulls_url":"https://api.github.com/repos/angular/material/pulls{/number}","milestones_url":"https://api.github.com/repos/angular/material/milestones{/number}","notifications_url":"https://api.github.com/repos/angular/material/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/angular/material/labels{/name}","releases_url":"https://api.github.com/repos/angular/material/releases{/id}","created_at":"2014-07-01T19:20:06Z","updated_at":"2015-12-02T03:22:47Z","pushed_at":"2015-12-02T03:51:04Z","git_url":"git://github.com/angular/material.git","ssh_url":"git@github.com:angular/material.git","clone_url":"https://github.com/angular/material.git","svn_url":"https://github.com/angular/material","homepage":"https://material.angularjs.org/","size":62320,"stargazers_count":11420,"watchers_count":11420,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":2106,"mirror_url":null,"open_issues_count":1308,"forks":2106,"open_issues":1308,"watchers":11420,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/angular/material/pulls/5972"},"html":{"href":"https://github.com/angular/material/pull/5972"},"issue":{"href":"https://api.github.com/repos/angular/material/issues/5972"},"comments":{"href":"https://api.github.com/repos/angular/material/issues/5972/comments"},"review_comments":{"href":"https://api.github.com/repos/angular/material/pulls/5972/comments"},"review_comment":{"href":"https://api.github.com/repos/angular/material/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/angular/material/pulls/5972/commits"},"statuses":{"href":"https://api.github.com/repos/angular/material/statuses/99744c16588d1928c0e921457c4521dfbfe05a9a"}}}}