Commit 423016f
committed
fix: only use trackByProp on row level with strict type
fix `DatatableComponent.trackByProp` which always returned undefined on group level by using key as index for group.
BREAKING CHANGE: `DatatableComponent.trackByProp` input now enforce strict type check as key of row.
Before:
// Even though name is not a valid prop on rows it is allowed to be used with `trackByProp`.
```
<ngx-datatable
trackByProp="'name'"
[rows]="[{id: 1}, {id: 2}]"
>
```
After:
Typescript would give compilation error as name is not know property in rows.1 parent 76d8825 commit 423016f
File tree
2 files changed
+4
-4
lines changed- projects/ngx-datatable/src/lib/components
- body
2 files changed
+4
-4
lines changedLines changed: 3 additions & 3 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
250 | 250 | | |
251 | 251 | | |
252 | 252 | | |
253 | | - | |
| 253 | + | |
254 | 254 | | |
255 | 255 | | |
256 | 256 | | |
| |||
419 | 419 | | |
420 | 420 | | |
421 | 421 | | |
422 | | - | |
423 | | - | |
| 422 | + | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
Lines changed: 1 addition & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
420 | 420 | | |
421 | 421 | | |
422 | 422 | | |
423 | | - | |
| 423 | + | |
424 | 424 | | |
425 | 425 | | |
426 | 426 | | |
| |||
0 commit comments