I am trying to integrate the inline edit with table tr
, i tried as follows: when user click edit i am switching to new class added with form.
<tbody>
<tr *ngFor="let item of data" *ngIf="item.Id !== editId; else #inlineEdit" [ngClass]="{'editEnabled' : item.Id === editId }">
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Description}}</td>
<td>{{item.UpdatedBy}}</td>
<td>{{item.UpdatedDate}}</td>
<td class="data-user-option">
<button type="button" class="edit-item" (click)="confirmEditRow(item)"></button>
<!-- <button type="button" class="delete-item" (click)="confirmRemoveRow(item)"></button> -->
</td>
<ng-container #inlineEdit>
<td>{{item.Id}}</td>
<td>{{item.Name}}</td>
<td>{{item.Description}}</td>
<td>{{item.UpdatedBy}}</td>
<td>{{item.UpdatedDate}}</td>
<td class="data-user-option">
<button type="button" class="edit-item" (click)="confirmEditRow(item)"></button>
</td>
</ng-container>
</tr>
</tbody>
But throws error with :
Uncaught Error: Template parse errors:
Can't have multiple template bindings on one element. Use only one attribute prefixed with * ("
</thead> -->
In this case how handle? how to fix the error or what is the correct way to do it?