Angular router Connection forwarding issue

33 Views Asked by At

I'm having a problem with Angular routerLink, can you please help me?

I Deleted AppComponent and created LoginComponent instead of this component. The home page is now the Login Login page. No problem so far.

I wrote routerLink"/erp" to the Login button on the login page. Component page to call: ErpComponent I could not fetch this page.

other redirects are working, just not going to Erp Component page.

Can you help me with this?

enter image description here

enter image description here

1

There are 1 best solutions below

2
brandt.codes On

First guess: the matcher is wrong and redirects all requests to "" (login). Please try this:

const routes: Routes [
  { path: 'login', component: LoginComponent ),
  { path: 'erp', component: ErpComponent ),
  { path: 'basvuru-yap', component: BasvuruYapComponent }
  { path: '', redirectTo: 'login', pathMatch: 'full' ),
];