Cześć stworzyłem dwa komponenty register i afterRdegister. i po kliknieciu register przeniosło nas do register after lecz gdy dodaje router link klikam to mam taki błąd:
ERROR Error: Uncaught (in promise): Error: Cannot match any routes. URL Segment: 'register/afterRegister'
Error: Cannot match any routes. URL Segment: 'register/afterRegister'
Mój button wygląda tak:
<button mat-raised-button
color="primary"
(click)="registerUser()"
routerLink="afterRegister">
Zarejestruj się
</button>
a app routing mofule tak:
const routes: Routes = [
{
path: '',
redirectTo: 'home',
pathMatch: 'full'
},
{
path: 'home',
component: HomeComponent
},
{
path: 'adminPanel',
component: AdminPanelComponent,
children: [
{
path: 'userList',
component: UserListComponent
},
{
path: 'companyList',
component: CompanyListComponent
},
{
path: 'tenureListAdmin',
component: TenureListAdminComponent
},
{
path: '',
redirectTo: 'userList',
pathMatch: 'full'
}
]
},
{
path: 'register',
component: RegisterComponent
},
{
path: 'login',
component: LoginComponent
},
{
path: 'ConfirmEmail/:email/:code',
component: EmailConfirmComponent
},
{
path: 'afterRegister',
component: AfterRegisterComponent
}
];
Jak mogę ten błąd naprawić ?