Commit 784febf3fc20e4bfb3dc2b5c1a6700da2d99ca7c

Authored by Vladyslav_Prykhodko
1 parent 3adbb94e

Added TrackBy in breadcrumb

... ... @@ -19,7 +19,7 @@
19 19 <h1 fxFlex fxHide.gt-sm *ngIf="lastBreadcrumb$ | async; let breadcrumb">
20 20 {{ breadcrumb.ignoreTranslate ? (breadcrumb.labelFunction ? breadcrumb.labelFunction() : breadcrumb.label) : (breadcrumb.label | translate) }}
21 21 </h1>
22   - <span fxHide.lt-md fxLayout="row" *ngFor="let breadcrumb of breadcrumbs$ | async; last as isLast;" [ngSwitch]="isLast">
  22 + <span fxHide.lt-md fxLayout="row" *ngFor="let breadcrumb of breadcrumbs$ | async; trackBy: trackByBreadcrumbs; last as isLast;" [ngSwitch]="isLast">
23 23 <a *ngSwitchCase="false" [routerLink]="breadcrumb.link" [queryParams]="breadcrumb.queryParams">
24 24 <mat-icon *ngIf="breadcrumb.isMdiIcon" [svgIcon]="breadcrumb.icon">
25 25 </mat-icon>
... ...
... ... @@ -110,4 +110,8 @@ export class BreadcrumbComponent implements OnInit, OnDestroy {
110 110 }
111 111 return newBreadcrumbs;
112 112 }
  113 +
  114 + trackByBreadcrumbs(index: number, breadcrumb: BreadCrumb){
  115 + return breadcrumb.labelFunction ? breadcrumb.labelFunction() : breadcrumb.label;
  116 + }
113 117 }
... ...