I'm getting a syntax error when I write this code...
<tbody>
<tr *ngFor="let incident of incidents | paginate: { itemsPerPage: itemsPerPage, currentPage: page }">
<td>{{ incident.name }}</td>
<td>{{ incident.type }}</td>
<td>{{ incident.str }}</td>
<td>{{ incident.mtdna }}</td>
<td>{{ incident.ystr }}</td>
<td>{{ incident.xstr }}</td>
<td>{{ incident.snps }}</td>
<td>
<button type="submit" (click)="editRecord({{incident.id}})" class="btn btn-primary float-start">
Edit {{ incident.id }}
</button>
</td>
</tr>
</tbody>
The issue is the (click)="editRecord({{incident.id}})" part of this code.
Angular 11 is not allowing me to embed the id into the editRecord() method call.
If I write (click)="editRecord(1), then the error goes away.
My question is, how do I embed the id into the editRecord method call?
There is no need for {{ }}, you can just avoid that becase (click)="expects variable or method calls or executable code"
<button type="submit" (click)="editRecord(incident.id)" class="btn btn-primary float-start">
Edit {{ incident.id }}
</button>