frontend/src/app/components/crumb-trail/crumb-trail.component.ts
import { Component, OnInit } from "@angular/core";
@Component({
selector: "app-crumb-trail",
templateUrl: "./crumb-trail.component.html",
styleUrls: ["./crumb-trail.component.scss"]
})
export class CrumbTrailComponent implements OnInit {
constructor() {}
/**
* An accessor to make the static variable available in the template
*/
get crumbs(): Crumb[] {
return CrumbTrailComponent.crumbs;
}
/**
* A list of crumbs to be displayed
*/
public static crumbs: Crumb[] = [];
ngOnInit() {}
}
/**
* The icons of the application
*/
export enum Icon {
Auth = "vpn_key",
Event = "blur_on",
Scan = "camera",
Inventory = "work",
Thing = "pages",
Add = "add",
Welcome = "home",
Stock = "fullscreen",
Category = "local_offer"
}
/**
* An item in the CrumbTrail
*/
export interface Crumb {
/**
* Determines the icon to be used
*/
icon?: Icon;
/**
* The title of the crumb
*/
title: string;
/**
* Where this crumb should link to
*/
routerLink?: string;
}