I searched quite a bit and did not find an answer that solved my problem. Therefore, I am posting this question.
My problem is very similar to this question. Angular 2.0.1 Router EmptyError: no items in sequence
But I could not solve it by adding pathMatch: 'full' ,.
I get an intermittent zonewaware error when I try to go from the list table (goes to the detailed view) below my module.
@NgModule({ imports: [ CommonModule, RouterModule.forChild([ { path: 'teams', component: TeamsListComponent, pathMatch: 'full', resolve: { TeamTemplate: TeamListTemplatesResolver }, canActivate: [AuthenticatedGuard] }, { path: 'teams/:id', component: TeamFormComponent, pathMatch: 'full', resolve: { team: TeamFormTeamResolver, resources: TeamFormResourcesResolver }, canActivate: [AuthenticatedGuard] } ]),
My authGuard service has a canActivate method that returns boolean.
public canActivate(): boolean { if (this.authService.isLoggedIn()) { return true; } this.router.navigate(['/logout', { redirect: location.pathname }]); return false; }
And here's the error: Zone Warning
I could get the router event log using {enableTracing: true}:
Router Event: NavigationStart Router Event: RoutesRecognized Router Event: GuardsCheckStart Router Event: GuardsCheckEnd Router Event: ResolveStart Router Event: NavigationError
source share