Be part of JetBrains PHPverse 2026 on June 9 – a free online event bringing PHP devs worldwide together.

Flex's avatar
Level 4

Can't bind to 'routerLink' since it isn't a known property of 'a'.ngtsc(-998002)

I have routerLink on My Angular App with Laravel API.

<a routerLink="employee/{{emp.id}}"><td> {{emp.first_name}}</td></a>

I have import routerLink as well in app.module.ts

import { RouterModule, Routes } from '@angular/router';
 imports: [
    BrowserModule,
    HttpClientModule,
    RouterModule.forRoot(appRouters),
    AppRoutingModule
  ],

but I got following error message with the link Can't bind to 'routerLink' since it isn't a known property of 'a'.ngtsc(-998002) employees.component.ts(8, 20): Error occurs in the template of component EmployeesComponent.

how to fix this?

0 likes
0 replies

Please or to participate in this conversation.