79684150

Date: 2025-06-30 01:04:07
Score: 1
Natty:
Report link

Since Angular 20 doesn't have a script with @NgModule, you can just import the RouterModule per component like so:

import { Component } from '@angular/core';
import { RouterModule } from '@angular/router';

@Component({
  selector: 'navbar',
  imports: [RouterModule],
  templateUrl: './navbar.html',
  styleUrl: './navbar.scss'
})

export class Navbar {

}

That fixed the error of "Can't bind to 'routerLink' since it isn't a known property of 'a'"

Reasons:
  • Has code block (-0.5):
  • Self-answer (0.5):
  • Low reputation (1):
Posted by: JOEMface