I'm studying angular and would like to navigate to another page when I click on the button. it happens to me that when I click they add the component of the second page under the button. I followed a thousand tutorials but I don't get the desired result!
<a class="card" routerLinkActive="active" routerLink="/prenota" >
<span style="margin: 14px;">Prenota</span> </a>
const routes: Routes = [
{ path: 'prenota', component: PrenotaComponent },
{ path: 'visualizza', component: VisualizzaComponent },
];
@NgModule({
imports: [RouterModule.forRoot(routes, {
onSameUrlNavigation: 'reload'
})],
exports: [RouterModule]
})