Browse Source

Track by improvement.

pull/253/head
Sebastian Stehle 9 years ago
parent
commit
006a4be303
  1. 2
      src/Squidex/app/features/content/pages/contents/contents-page.component.html
  2. 4
      src/Squidex/app/features/content/pages/contents/contents-page.component.ts

2
src/Squidex/app/features/content/pages/contents/contents-page.component.html

@ -122,7 +122,7 @@
<div sqxIgnoreScrollbar> <div sqxIgnoreScrollbar>
<table class="table table-items table-fixed" *ngIf="contentItems" > <table class="table table-items table-fixed" *ngIf="contentItems" >
<tbody *ngIf="!isReadOnly"> <tbody *ngIf="!isReadOnly">
<ng-template ngFor let-content [ngForOf]="contentItems"> <ng-template ngFor let-content [ngForOf]="contentItems" [ngForTrackBy]="trackBy">
<tr [sqxContent]="content" [routerLink]="[content.id]" routerLinkActive="active" <tr [sqxContent]="content" [routerLink]="[content.id]" routerLinkActive="active"
[language]="languageSelected" [language]="languageSelected"
[schemaFields]="contentFields" [schemaFields]="contentFields"

4
src/Squidex/app/features/content/pages/contents/contents-page.component.ts

@ -361,6 +361,10 @@ export class ContentsPageComponent implements OnDestroy, OnInit {
this.ctx.bus.emit(new ContentRemoved(content)); this.ctx.bus.emit(new ContentRemoved(content));
} }
public trackBy(content: ContentDto): string {
return content.id;
}
private resetContents() { private resetContents() {
this.contentItems = ImmutableArray.empty<ContentDto>(); this.contentItems = ImmutableArray.empty<ContentDto>();
this.contentsQuery = ''; this.contentsQuery = '';

Loading…
Cancel
Save