ThingList trackBy

This commit is contained in:
Patrick Haßel 2024-11-29 13:18:28 +01:00
parent 4fd64acf09
commit b3ecb231c8
2 changed files with 3 additions and 1 deletions

View File

@ -1,5 +1,5 @@
<div class="tileContainer">
<app-thing-tile [now]="now" [thing]="thing" *ngFor="let thing of sorted()"></app-thing-tile>
<app-thing-tile [now]="now" [thing]="thing" *ngFor="let thing of sorted(); trackBy: Thing.trackBy"></app-thing-tile>
</div>

View File

@ -16,6 +16,8 @@ import {Thing} from '../Thing';
})
export class ThingListComponent implements OnInit, OnDestroy {
protected readonly Thing = Thing;
private readonly subs: Subscription[] = [];
protected now: Date = new Date();