xng-breadcrumb
Version:
A declarative and reactive breadcrumb approach for Angular 6 and beyond https://www.npmjs.com/package/xng-breadcrumb
42 lines (41 loc) • 1.62 kB
TypeScript
import { OnInit, TemplateRef } from '@angular/core';
import { Observable } from 'rxjs';
import { BreadcrumbService } from './breadcrumb.service';
import { Breadcrumb } from './breadcrumb';
export declare class BreadcrumbComponent implements OnInit {
private breadcrumbService;
breadcrumbs$: Observable<Breadcrumb[]>;
separatorTemplate: TemplateRef<void>;
private _separator;
/**
* Breadcrumb item can be customized with this template
* Template context is provided label, additional info, first and last indexes
* Use cases:
* 1) Add an icon along with label
* 2) i18n. {{breadcrumb | translate}} or {{breadcrumb | transloco}}
* 3) Change text case {{breadcrumb | titlecase}}
*/
itemTemplate: any;
/**
* If true, breacrumb is auto generated even without any mapping label
* Default label is same as route segment
*/
autoGenerate: boolean;
/**
* custom class provided by consumer to increase specificity
* This will benefit to override styles that are conflicting
*/
class: string;
/**
* separator between breadcrumbs, defaults to '/'.
* User can customize separator either by passing a String or Template
*
* String --> Ex: <xng-breadcrumb separator="-"> </xng-breadcrumb>
*
* Template --> Ex: <xng-breadcrumb [separator]="separatorTemplate"> </xng-breadcrumb>
* <ng-template #separatorTemplate><mat-icon>arrow_right</mat-icon></ng-template>
*/
separator: string | TemplateRef<void>;
constructor(breadcrumbService: BreadcrumbService);
ngOnInit(): void;
}