|
1 | | -<nav |
2 | | - *ngIf="this.breakpointInputs().crumbs.length > 0" |
3 | | - aria-label="Breadcrumb" |
4 | | - class="tedi__breadcrumbs" |
5 | | -> |
6 | | - <ol class="tedi__breadcrumbs__list"> |
7 | | - <ng-container *ngIf="!this.breakpointInputs().shortCrumbs"> |
8 | | - <ng-container |
9 | | - *ngFor="let crumb of this.breakpointInputs().crumbs; let last = last" |
10 | | - > |
11 | | - @if (!last) { |
12 | | - <li class="tedi__breadcrumbs__item"> |
13 | | - <a tedi-link [routerLink]="crumb.href" [underline]="false">{{ |
14 | | - crumb.label |
15 | | - }}</a> |
16 | | - <tedi-icon color="brand" name="chevron_right" /> |
17 | | - </li> |
18 | | - } @else { |
19 | | - <li |
20 | | - aria-current="page" |
21 | | - tedi-text |
22 | | - modifiers="inline-block" |
23 | | - color="secondary" |
24 | | - > |
25 | | - {{ crumb.label }} |
26 | | - </li> |
| 1 | +@if (breakpointInputs().crumbs.length > 0) { |
| 2 | + <nav aria-label="Breadcrumb" class="tedi-breadcrumbs"> |
| 3 | + <ol class="tedi-breadcrumbs__list"> |
| 4 | + @if (!breakpointInputs().shortCrumbs) { |
| 5 | + @for (crumb of breakpointInputs().crumbs; track crumb.href; let last = $last) { |
| 6 | + @if (!last) { |
| 7 | + <li class="tedi-breadcrumbs__item"> |
| 8 | + <a tedi-link [routerLink]="crumb.href" [underline]="false">{{ |
| 9 | + crumb.label |
| 10 | + }}</a> |
| 11 | + <tedi-icon color="brand" name="chevron_right" /> |
| 12 | + </li> |
| 13 | + } @else { |
| 14 | + <li |
| 15 | + aria-current="page" |
| 16 | + tedi-text |
| 17 | + modifiers="inline-block" |
| 18 | + color="secondary" |
| 19 | + > |
| 20 | + {{ crumb.label }} |
| 21 | + </li> |
| 22 | + } |
27 | 23 | } |
28 | | - </ng-container> |
29 | | - </ng-container> |
30 | | - </ol> |
31 | | - <ng-container |
32 | | - *ngIf=" |
33 | | - this.breakpointInputs().crumbs.length > 1 && |
34 | | - this.breakpointInputs().shortCrumbs |
35 | | - " |
36 | | - > |
37 | | - <div class="tedi__breadcrumbs__item"> |
38 | | - <tedi-icon color="brand" name="arrow_back" /> |
39 | | - <a |
40 | | - tedi-link |
41 | | - [routerLink]="getSecondLastCrumb()?.href" |
42 | | - [underline]="false" |
43 | | - >{{ getSecondLastCrumb()?.label }}</a |
44 | | - > |
45 | | - </div> |
46 | | - </ng-container> |
47 | | -</nav> |
| 24 | + } |
| 25 | + </ol> |
| 26 | + @if (breakpointInputs().crumbs.length > 1 && breakpointInputs().shortCrumbs) { |
| 27 | + <div class="tedi-breadcrumbs__item"> |
| 28 | + <tedi-icon color="brand" name="arrow_back" /> |
| 29 | + <a |
| 30 | + tedi-link |
| 31 | + [routerLink]="getSecondLastCrumb()?.href" |
| 32 | + [underline]="false" |
| 33 | + >{{ getSecondLastCrumb()?.label }}</a |
| 34 | + > |
| 35 | + </div> |
| 36 | + } |
| 37 | + </nav> |
| 38 | +} |
0 commit comments