From 25589095316ecf21f0dae7ac5da633a3d0a9e600 Mon Sep 17 00:00:00 2001 From: "AFELIO\\a.thiry" Date: Wed, 24 Feb 2021 13:47:48 +0100 Subject: [PATCH] fix: change breadcrumb array to observable with pipe async --- .../src/lib/breadcrumb.component.html | 2 +- .../src/lib/breadcrumb.component.ts | 36 +++++++++---------- 2 files changed, 17 insertions(+), 21 deletions(-) diff --git a/libs/xng-breadcrumb/src/lib/breadcrumb.component.html b/libs/xng-breadcrumb/src/lib/breadcrumb.component.html index de907ab..7a8a31b 100644 --- a/libs/xng-breadcrumb/src/lib/breadcrumb.component.html +++ b/libs/xng-breadcrumb/src/lib/breadcrumb.component.html @@ -2,7 +2,7 @@
    { // Do not mutate breadcrumb as its source of truth. // There can be scenarios where we can have multiple xng-breadcrumb instances in page return { @@ -100,21 +107,10 @@ export class BreadcrumbComponent implements OnInit, OnDestroy { : undefined, fragment: this.preserveFragment ? breadcrumb.fragment : undefined, }; - }) - .filter((breadcrumb) => { - // Usually, breadcrumb list can contain a combination of auto generated and user specified labels - // this filters autogenerated labels in case of "[autoGenerate]: false" - if (this.autoGenerate) { - return true; - } - return !breadcrumb.isAutoGeneratedLabel; }); - } + }) ); } - ngOnDestroy() { - this.subscription.unsubscribe(); - } handleRoute(breadcrumb: BreadcrumbDefinition) { const routeLink = breadcrumb.routeInterceptor