From 6c00ae83d6b0411babcb3c758d0c3c6da16623a5 Mon Sep 17 00:00:00 2001 From: Arman Ozak Date: Wed, 3 Jun 2020 12:15:21 +0300 Subject: [PATCH] fix: remove query params, fragments, and aux before path comparison --- .../src/lib/components/breadcrumb/breadcrumb.component.ts | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts b/npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts index e67d3fa346..27fd96a201 100644 --- a/npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts +++ b/npm/ng-packs/packages/theme-shared/src/lib/components/breadcrumb/breadcrumb.component.ts @@ -1,7 +1,7 @@ -import { Component, OnInit, Input } from '@angular/core'; +import { ABP, ConfigState } from '@abp/ng.core'; +import { Component, Input, OnInit } from '@angular/core'; import { Router } from '@angular/router'; import { Store } from '@ngxs/store'; -import { ConfigState, ABP } from '@abp/ng.core'; @Component({ selector: 'abp-breadcrumb', @@ -41,7 +41,9 @@ export class BreadcrumbComponent implements OnInit { let childRoute: ABP.FullRoute = currentUrl; for (let i = 0; i < arr.length; i++) { - const element = arr[i]; + const element = String(arr[i]) + .split(/[?#(]/) + .shift(); if (!childRoute.children || !childRoute.children.length) return; childRoute = childRoute.children.find(child => child.path === element);