Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Data Bind RouterLink (Angular 2) - Got interpolation ({{}}) where expression was expected at column 3

I'm having some problems passing data to my routerLink. Here is what I'm trying to do: (this input is inside a ngFor, I need to change the route when the id reaches 4)

 <input type="button" class="btn-cards" [ngClass]="getStyle(negociacao)"  [routerLink]="['/{{negociacao.rota}}', negociacao.id]" value="{{negociacao.status}}">

The error I'm getting is the following one:

Got interpolation ({{}}) where expression was expected at column 3

Thanks in advance :)

like image 629
Renê Silva Lima Avatar asked Nov 16 '25 02:11

Renê Silva Lima


1 Answers

You should not be using {{}}(interpolation) inside routerLink directive.

[routerLink]="['/', negociacao.rota, negociacao.id]"
like image 89
Pankaj Parkar Avatar answered Nov 17 '25 19:11

Pankaj Parkar