Commit d43517c
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 babdc44 commit d43517c
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 | |
|---|---|---|---|
| |||
278 | 278 | | |
279 | 279 | | |
280 | 280 | | |
281 | | - | |
| 281 | + | |
282 | 282 | | |
283 | 283 | | |
284 | 284 | | |
| |||
394 | 394 | | |
395 | 395 | | |
396 | 396 | | |
397 | | - | |
398 | | - | |
| 397 | + | |
| 398 | + | |
399 | 399 | | |
400 | 400 | | |
401 | 401 | | |
| |||
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