Skip to content

Commit 3065f1d

Browse files
committed
Add trackBy function
1 parent e13869c commit 3065f1d

File tree

2 files changed

+2
-1
lines changed

2 files changed

+2
-1
lines changed

libs/schematic/generators/ng-generate/components/shared/methods/generation/extended-table.html.template

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
matSort
66
matSortDisableClear="true"
77
[matSortDisabled]="dragging"
8+
[trackBy]="trackBy"
89
(matSortChange)="sortData()"
910
[matSortActive]="columnToSort.sortColumnName" [matSortDirection]="columnToSort.sortDirection"
1011
[ngClass]="customTableClass"

libs/schematic/generators/ng-generate/components/shared/methods/generation/simple-table.html.template

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
<button mat-raised-button color="warn" [disabled]="selection.selected.length === -1" (click)="deleteRow()">Delete</button>
77
</div>
88

9-
<table mat-table class="full-width-table" [dataSource]="dataSource" aria-label="Elements" data-test="table">
9+
<table mat-table class="full-width-table" [dataSource]="dataSource" [trackBy]="trackBy" aria-label="Elements" data-test="table">
1010
<!-- Row shown when there is no matching data that will be provided to the wrapper table. -->
1111
<tr data-test="no-data-table-row" class="mat-row" *matNoDataRow>
1212
<td *ngIf="!dataSource.data.length" class="mat-cell" [colSpan]="displayedColumns.length" data-test="no-data-table-cell">

0 commit comments

Comments
 (0)