Skip to content

Commit 99e4f65

Browse files
spike-rabbitfh1ch
authored andcommitted
refactor: convert rowIdentity to signal input
1 parent bffcbec commit 99e4f65

File tree

2 files changed

+3
-3
lines changed

2 files changed

+3
-3
lines changed

projects/ngx-datatable/src/lib/components/datatable.component.html

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -53,7 +53,7 @@
5353
[innerWidth]="_innerWidth()"
5454
[bodyHeight]="bodyHeight()"
5555
[selectionType]="selectionType()"
56-
[rowIdentity]="rowIdentity"
56+
[rowIdentity]="rowIdentity()"
5757
[rowClass]="rowClass()"
5858
[selectCheck]="selectCheck()"
5959
[displayCheck]="displayCheck()"

projects/ngx-datatable/src/lib/components/datatable.component.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -838,15 +838,15 @@ export class DatatableComponent<TRow extends Row = any>
838838
*
839839
* (`fn(x) === fn(y)` instead of `x === y`)
840840
*/
841-
@Input() rowIdentity: (x: RowOrGroup<TRow>) => unknown = x => {
841+
readonly rowIdentity = input<(x: RowOrGroup<TRow>) => unknown>(x => {
842842
if (this.groupRowsBy()) {
843843
// each group in groupedRows are stored as {key, value: [rows]},
844844
// where key is the groupRowsBy index
845845
return (x as Group<TRow>).key ?? x;
846846
} else {
847847
return x;
848848
}
849-
};
849+
});
850850

851851
/**
852852
* Creates a map with the data grouped by the user choice of grouping index

0 commit comments

Comments
 (0)