{"action":"created","issue":{"url":"https://api.github.com/repos/kentcdodds/kcd-angular/issues/8","repository_url":"https://api.github.com/repos/kentcdodds/kcd-angular","labels_url":"https://api.github.com/repos/kentcdodds/kcd-angular/issues/8/labels{/name}","comments_url":"https://api.github.com/repos/kentcdodds/kcd-angular/issues/8/comments","events_url":"https://api.github.com/repos/kentcdodds/kcd-angular/issues/8/events","html_url":"https://github.com/kentcdodds/kcd-angular/issues/8","id":177265897,"number":8,"title":"kcd-recompile: child component scopes not destroyed on recompile","user":{"login":"pos1tron","id":586635,"avatar_url":"https://avatars.githubusercontent.com/u/586635?v=3","gravatar_id":"","url":"https://api.github.com/users/pos1tron","html_url":"https://github.com/pos1tron","followers_url":"https://api.github.com/users/pos1tron/followers","following_url":"https://api.github.com/users/pos1tron/following{/other_user}","gists_url":"https://api.github.com/users/pos1tron/gists{/gist_id}","starred_url":"https://api.github.com/users/pos1tron/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pos1tron/subscriptions","organizations_url":"https://api.github.com/users/pos1tron/orgs","repos_url":"https://api.github.com/users/pos1tron/repos","events_url":"https://api.github.com/users/pos1tron/events{/privacy}","received_events_url":"https://api.github.com/users/pos1tron/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-09-15T19:25:06Z","updated_at":"2016-09-15T19:26:12Z","closed_at":null,"body":"Oops, just added this to your gist, but then noticed your other comment mentioning you don't get notifications for comments on gists.\r\n\r\nCame across an interesting issue. I'm still debugging, but it appears that child component scopes are never destroyed when I do a recompile using this directive. Say I have the following:\r\n\r\n```\r\n<div kcd-recompile=\"$ctrl.reload\" use-boolean>\r\n  <custom-component ng-repeat=\"item in ::$ctrl.items\"></custom-component>\r\n</div>\r\n```\r\n\r\nAfter I set `this.reload = true` in the parent component controller and I see the ng-repeat recompile, if I check the scope tree in batarang, I can see all of the old custom-component scopes still hanging out there, and they continue to stack up each time I recompile.\r\n\r\nI tried adding `this.$element.on('destroy', () => this.$scope.destroy())` in my custom-component, and I added a console.log to the $onDestroy hook, and I can see that $onDestroy fires, but it seems like the scope is being recreated or something because the logs continue to compound after each reload. Any ideas?"},"comment":{"url":"https://api.github.com/repos/kentcdodds/kcd-angular/issues/comments/247426973","html_url":"https://github.com/kentcdodds/kcd-angular/issues/8#issuecomment-247426973","issue_url":"https://api.github.com/repos/kentcdodds/kcd-angular/issues/8","id":247426973,"user":{"login":"kentcdodds","id":1500684,"avatar_url":"https://avatars.githubusercontent.com/u/1500684?v=3","gravatar_id":"","url":"https://api.github.com/users/kentcdodds","html_url":"https://github.com/kentcdodds","followers_url":"https://api.github.com/users/kentcdodds/followers","following_url":"https://api.github.com/users/kentcdodds/following{/other_user}","gists_url":"https://api.github.com/users/kentcdodds/gists{/gist_id}","starred_url":"https://api.github.com/users/kentcdodds/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/kentcdodds/subscriptions","organizations_url":"https://api.github.com/users/kentcdodds/orgs","repos_url":"https://api.github.com/users/kentcdodds/repos","events_url":"https://api.github.com/users/kentcdodds/events{/privacy}","received_events_url":"https://api.github.com/users/kentcdodds/received_events","type":"User","site_admin":false},"created_at":"2016-09-15T19:26:12Z","updated_at":"2016-09-15T19:26:12Z","body":"Hi @pos1tron,\r\nI'm sorry, but I'm not really maintaining this repo or working with angular anymore. I'm not sure how to help you. Maybe try stack overflow?"}}
{"actor":{"display_login":"kentcdodds"}}