My routerlink is working but after trying to convert it to a function it just does nothing. I have tried many things already: '/description' 'description' '/description/'.
before:
<a [routerLink]="['description', course.id]">Go to description</a>
After (.html):
<a (click)="goToDescription(course.id)">Go to description</a>
After (.ts):
goToDescription(id) {
this.router.navigate([`description`, id]);
}
Route Description:
{
path: 'description/:course-id', component: CourseDescriptionComponent,
},
Any help would be appreciated. Thanks!
<a>is being used with onclick rather than routerLink/href in addition to no preventDefault() occurring in the handler.