EchoTex_Payroll/HRM.UI/ClientApp/src/app/app.breadcrumb.component.ts
2024-10-14 10:01:49 +06:00

28 lines
726 B
TypeScript

import { Component, OnDestroy } from '@angular/core';
import { BreadcrumbService } from './app.breadcrumb.service';
import { Subscription } from 'rxjs';
import { MenuItem } from 'primeng/api';
@Component({
selector: 'app-breadcrumb',
templateUrl: './app.breadcrumb.component.html'
})
export class AppBreadcrumbComponent implements OnDestroy {
subscription: Subscription;
items: MenuItem[];
constructor(public breadcrumbService: BreadcrumbService) {
this.subscription = breadcrumbService.itemsHandler.subscribe(response => {
this.items = response;
});
}
ngOnDestroy() {
if (this.subscription) {
this.subscription.unsubscribe();
}
}
}