I've got a problem with Angular Router (Angular 11). That's my routing below:
{path: '', redirectTo: '/zaloguj', pathMatch: 'full'}
{path: 'zaloguj', component: LoginComponent}
{path: 'orzeczenia', component: ApiComponent}
{path: 'orzeczenia/:id', component: ShowDataComponent}
{path: 'kontakt', component: ContactComponent}
{path: 'konto', component: DashboardComponent}
{path: '**', component: PageNotFoundComponent}
I created the function (below) in one of my component:
showVerdict(): any {
this.router.navigate(['/kontakt']);
}
When I use this function, Angular goes to the Kontakt Route (ContactComponent), but after maybe 1 sec, redirects to MainPage. I changed the route to for example "konto", etc. however, the problem still occurs. Please help me!
question from:
https://stackoverflow.com/questions/65912191/angular-router-always-get-back-to-main-page 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…