I am currently working on a Component that displays a list of projects, along with Edit and Delete buttons.
When the delete button is clicked:
onDelete(projectName: string): void {
this.projectService.deleteProject(projectName);
this.router.navigate(['/projects']);
}
Within my router component:
export const projectListRouters: Routes = [
{
path: '',
children: [
{path: '', component: URLComponent},
{path: 'login', component: Login},
{path: 'projects', canActivate: [AuthGuard], component: ProjectListComponent},
{path: 'project/new/-', component: ProjectDetails, canActivate: [AuthGuard], data: {oparationType: 'new'}},
// otherwise redirect to home
{path: '**', redirectTo: ''}
],
},
];
The issue I am facing is that when I use this.router.navigate(['/projects']), the list is not being refreshed after deleting a project.