I’m trying to create an small app but in this moment I’m having this error with the routerLink by console. PD I’m new to angular
✘ [ERROR] NG8002: Can’t bind to ‘routerLink’ since it isn’t a known property of ‘a’.
and this is the html code:
<a [routerLink]="['/gastos', expense.id, 'Edit']">
<i class="ri-edit-box-line"></i>
</a>
What do you think is my mistake?
The only configuration files I can modify are:
app.config.ts
app.routes.ts
2
Answers
please make sure you have
@angular/router": "^17.3.0
in your package.json fileand import
RouterModule
in app.moduleif you have
appRoutingModule
then import it inimports: [appRoutingModule]
If you’re using standalone components then just import RouterLink and it should work.