{"action":"created","issue":{"url":"https://api.github.com/repos/angular/angular/issues/11664","repository_url":"https://api.github.com/repos/angular/angular","labels_url":"https://api.github.com/repos/angular/angular/issues/11664/labels{/name}","comments_url":"https://api.github.com/repos/angular/angular/issues/11664/comments","events_url":"https://api.github.com/repos/angular/angular/issues/11664/events","html_url":"https://github.com/angular/angular/issues/11664","id":177436308,"number":11664,"title":"Router: CanDeactivate guard doesn't fire on changing parent segment","user":{"login":"aboris0v","id":4869533,"avatar_url":"https://avatars.githubusercontent.com/u/4869533?v=3","gravatar_id":"","url":"https://api.github.com/users/aboris0v","html_url":"https://github.com/aboris0v","followers_url":"https://api.github.com/users/aboris0v/followers","following_url":"https://api.github.com/users/aboris0v/following{/other_user}","gists_url":"https://api.github.com/users/aboris0v/gists{/gist_id}","starred_url":"https://api.github.com/users/aboris0v/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/aboris0v/subscriptions","organizations_url":"https://api.github.com/users/aboris0v/orgs","repos_url":"https://api.github.com/users/aboris0v/repos","events_url":"https://api.github.com/users/aboris0v/events{/privacy}","received_events_url":"https://api.github.com/users/aboris0v/received_events","type":"User","site_admin":false},"labels":[{"url":"https://api.github.com/repos/angular/angular/labels/comp:%20router","name":"comp: router","color":"c7def8"}],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":4,"created_at":"2016-09-16T14:15:05Z","updated_at":"2016-10-18T16:00:30Z","closed_at":"2016-10-04T21:26:43Z","body":"**I'm submitting a ...**  (check one with \"x\")\r\n```\r\n[x] bug report => search github for a similar issue or PR before submitting\r\n[ ] feature request\r\n[ ] support request => Please do not submit support request here, instead see https://github.com/angular/angular/blob/master/CONTRIBUTING.md#question\r\n```\r\n\r\n**Current behavior** \r\nHaving following routes \r\nexport const routes: Routes = [\r\n       .........\r\n\tpath: 'order/:id', component: ExistingOrderComponent,\r\n\tchildren: [\r\n\t\t{ path: '', redirectTo: 'summary', pathMatch: 'full' },\r\n\t\t{ path: 'summary', component: SummaryComponent},\r\n\t\t{ path: 'edit', component: EditComponent, canDeactivate: [CanDeactivateGuard]\t}\r\n];\r\nCanDeactivateGuard is being activated on changing route between children nodes (eg: order/1/edit -> order/1/summary), but it doesn't when parent is changed (eg: order/1/edit -> order/2/edit)\r\n\r\n**Expected behavior**\r\nI think that CanDeactivateGuard set on a children segment has to be fired when its parent segment is changed and as it seems to me it has to be fired before parent's guard (if specified)\r\n\r\n**Reproduction of the problem**\r\ndemo of the problem is here http://plnkr.co/edit/4TT1iC?p=preview\r\n\r\n* **Angular version:** 2.0.0 and below\r\n \r\n"},"comment":{"url":"https://api.github.com/repos/angular/angular/issues/comments/254554473","html_url":"https://github.com/angular/angular/issues/11664#issuecomment-254554473","issue_url":"https://api.github.com/repos/angular/angular/issues/11664","id":254554473,"user":{"login":"tdsmithATabc","id":20977267,"avatar_url":"https://avatars.githubusercontent.com/u/20977267?v=3","gravatar_id":"","url":"https://api.github.com/users/tdsmithATabc","html_url":"https://github.com/tdsmithATabc","followers_url":"https://api.github.com/users/tdsmithATabc/followers","following_url":"https://api.github.com/users/tdsmithATabc/following{/other_user}","gists_url":"https://api.github.com/users/tdsmithATabc/gists{/gist_id}","starred_url":"https://api.github.com/users/tdsmithATabc/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tdsmithATabc/subscriptions","organizations_url":"https://api.github.com/users/tdsmithATabc/orgs","repos_url":"https://api.github.com/users/tdsmithATabc/repos","events_url":"https://api.github.com/users/tdsmithATabc/events{/privacy}","received_events_url":"https://api.github.com/users/tdsmithATabc/received_events","type":"User","site_admin":false},"created_at":"2016-10-18T16:00:30Z","updated_at":"2016-10-18T16:00:30Z","body":"Also in regard to the current behavior, it doesn't seem like `canDeactivateChild` would help in the general case. If I have some deep child X I'm departing, the `canDeactivateChild` guard would need to live on X's parent, right? There's no guarantee that that \"boundary\" is the one that makes semantic sense for the wrap-up though."}}
{"actor":{"display_login":"tdsmithATabc"}}