2020-04-23 17:58:04 +02:00
|
|
|
import {Component, Input} from "@angular/core";
|
|
|
|
|
|
|
|
export interface Breadcrumb {
|
|
|
|
name: string;
|
|
|
|
route?: string;
|
|
|
|
}
|
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'breadcrumbs',
|
|
|
|
template: `
|
2020-04-27 10:14:05 +02:00
|
|
|
<ul [class]="'uk-breadcrumb '+addClass" [class.uk-light]="light">
|
2020-04-23 17:58:04 +02:00
|
|
|
<li *ngFor="let breadcrumb of breadcrumbs">
|
|
|
|
<a class="uk-text-capitalize" *ngIf="breadcrumb.route" [routerLink]="breadcrumb.route">{{breadcrumb.name}}</a>
|
|
|
|
<span class="uk-text-capitalize" *ngIf="!breadcrumb.route">{{breadcrumb.name}}</span>
|
|
|
|
</li>
|
|
|
|
</ul>`
|
|
|
|
})
|
|
|
|
export class BreadcrumbsComponent {
|
|
|
|
|
|
|
|
@Input() public light: boolean = false;
|
|
|
|
@Input() public breadcrumbs: Breadcrumb[] = [];
|
2020-04-28 12:46:23 +02:00
|
|
|
@Input() public addClass = "";
|
2020-04-27 10:14:05 +02:00
|
|
|
}
|