Although I have used a previous stackoverflow solution, I still get the same error. The other problem is that there is no script in Angular 20 that has @NgModule. Here is the code I have:
navbar.html
<li class="nav-item">
<a class="nav-link" [routerLink]="['/']" [routerLinkActive]="['active']">Home</a>
</li>
<li class="nav-item">
<a class="nav-link" [routerLink]="['/contact']" [routerLinkActive]="['active']">Contact</a>
</li>
navbar.ts
import { Component } from '@angular/core';
@Component({
selector: 'navbar',
imports: [],
templateUrl: './navbar.html',
styleUrl: './navbar.scss'
})
export class Navbar {
}