{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/5275","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/5275/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/5275/comments","events_url":"https://api.github.com/repos/angular/angular/issues/5275/events","html_url":"https://github.com/angular/angular/issues/5275","id":116796322,"number":5275,"title":"Programmatically prevent the destruction of components when requested","user":{"login":"cangosta","id":848857,"avatar_url":"https://avatars.githubusercontent.com/u/848857?v=3","gravatar_id":"","url":"https://api.github.com/users/cangosta","html_url":"https://github.com/cangosta","followers_url":"https://api.github.com/users/cangosta/followers","following_url":"https://api.github.com/users/cangosta/following{/other_user}","gists_url":"https://api.github.com/users/cangosta/gists{/gist_id}","starred_url":"https://api.github.com/users/cangosta/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cangosta/subscriptions","organizations_url":"https://api.github.com/users/cangosta/orgs","repos_url":"https://api.github.com/users/cangosta/repos","events_url":"https://api.github.com/users/cangosta/events{/privacy}","received_events_url":"https://api.github.com/users/cangosta/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8"},{"url":"https://api.github.com/repos/angular/angular/labels/effort2:%20medium%20(day)","name":"effort2: medium (day)","color":"bfe5bf"},{"url":"https://api.github.com/repos/angular/angular/labels/P3:%20important","name":"P3: important","color":"fef2c0"},{"url":"https://api.github.com/repos/angular/angular/labels/state:%20Needs%20Design","name":"state: Needs Design","color":"006b75"},{"url":"https://api.github.com/repos/angular/angular/labels/type:%20feature","name":"type: feature","color":"EEEEEE"}],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":16,"created_at":"2015-11-13T15:57:12Z","updated_at":"2016-02-23T14:56:02Z","closed_at":null,"body":"It would be nice if we could tell angular not to destroy components when we navigate out of them, even if the next component is of a different type. This could be useful, for example, when building a window management system, where users can navigate through different windows (components) without\r\nthe need for recovering the whole state. \r\n\r\nThe existing canReuse hook is not useful for this use case, since it only allows us to reuse components if the previous and the next component have the same type.\r\n\r\nCode example:\r\n\r\n```javascript\r\n@Component({...})\r\nclass ExampleComponent {\r\n\tcanDestroy() { // or some other name\r\n\t  return this.closeButtonClicked;\r\n\t}\r\n}\r\n```"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/187728706","html_url":"https://github.com/angular/angular/issues/5275#issuecomment-187728706","issue_url":"https://api.github.com/repos/angular/angular/issues/5275","id":187728706,"user":{"login":"mnvx","id":829880,"avatar_url":"https://avatars.githubusercontent.com/u/829880?v=3","gravatar_id":"","url":"https://api.github.com/users/mnvx","html_url":"https://github.com/mnvx","followers_url":"https://api.github.com/users/mnvx/followers","following_url":"https://api.github.com/users/mnvx/following{/other_user}","gists_url":"https://api.github.com/users/mnvx/gists{/gist_id}","starred_url":"https://api.github.com/users/mnvx/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mnvx/subscriptions","organizations_url":"https://api.github.com/users/mnvx/orgs","repos_url":"https://api.github.com/users/mnvx/repos","events_url":"https://api.github.com/users/mnvx/events{/privacy}","received_events_url":"https://api.github.com/users/mnvx/received_events","type":"User","site_admin":false},"created_at":"2016-02-23T14:56:02Z","updated_at":"2016-02-23T14:56:02Z","body":"+1 Will be nice to store states with Angular2 capacibilities"}}