angular 2 candeactivate not working with child components

Viewed 1184

I have form in child components and i put child component under parent-component form. I have implemented canDeactivate which is not working for child component.

export const routes: Routes = [
  {path: '', component: AppComponent,children:[
  {path:'user/new',component:UserFormComponent,canDeactivate: [CanDeactivateGuard]},
  {path:'',component:UserListComponent}
]},
];

The following stackblitz example. Stackblitz exmaple for candeactivate

Can anyone help me, where i am doing wrong

0 Answers
Related