Merge pull request #4195 from abpframework/fix/4194

Fixed Breadcrumb Error When Route Has Query Params, Fragment, or Auxiliary Route
rel-2.9
Mehmet Erim 5 years ago committed by GitHub
commit cf1f893e23
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -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);

Loading…
Cancel
Save