Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Defining breadcrump in child not working with empty route #25

Closed
Benny739 opened this issue Dec 31, 2019 · 7 comments
Closed

Defining breadcrump in child not working with empty route #25

Benny739 opened this issue Dec 31, 2019 · 7 comments

Comments

@Benny739
Copy link

Hi,

setting breadcrumb in a lazy loaded child module with empty route is not working.

My parent Route:
{
path: 'courses',
data: {
breadcrumb: 'Deine Kurse'
},
loadChildren: () => import('./courses/courses.module').then(mod => mod.CoursesModule)
},

Route in the child module:
{
path: '',
pathMatch: 'full',
component: CoursesOverviewComponent,
data: {
breadcrumb: 'Deine Kurse Neu'
}
},

This ends in no custom breadcrumb data at all. If I remove the breadcrumb from the child, the value from the parent is shown. If the route from the child is not empty, everything is working fine. No data on the parent also makes no difference.

Regards
Benny

@udayvunnam
Copy link
Owner

Hi Benny,

It is by design, we have made this pattern. Breadcrumbs can be shown for routes that can be differentiated by the path.

In your example, you would want to choose breadcrumb for path "/courses" on either parent on children. If it's defined at many places for the same path then the deepest child takes priority.

Please check https://github.com/udayvunnam/xng-breadcrumb#where-to-define-breadcrumbs-if-routes-path-have-same-route-specificity

@udayvunnam
Copy link
Owner

@Benny739

@patogalla
Copy link

It happens the same to me in the last version.
I had to add, twice "breadcrumb" key.
For instance:

{
path: '',
data: { breadcrumb: {breadcrumb: 'Organizations'} },
component: ...
},

@udayvunnam
Copy link
Owner

Hi, @patogalla! Can you provide the Angular and xng-breadcrumb version you have faced this issue on?

Also, I see that you are defining it wrongly.

Use one of the below patterns -

@udayvunnam udayvunnam reopened this Jan 20, 2020
@patogalla
Copy link

patogalla commented Jan 22, 2020

Hi @udayvunnam , thanks for the response.
Here are the versions:
Angular: 8.2.14
xng-breadcrumb: 3.8.0

Regarding the way i defined in my project, is after debuging your code, found that if i put the breadcrumb object inside another breadcrumb object it worked.
I think it has to be with nested routes, and the way it handle it.
I have like a 3 or 4 level depth routing.

Any thing you need, just ask me, i'd be glad to help.

@udayvunnam
Copy link
Owner

udayvunnam commented Jan 27, 2020

Hi @patogalla can you try with latest version where a couple of bugs are addressed.
https://github.com/udayvunnam/xng-breadcrumb#angular-version-compatibility

@udayvunnam
Copy link
Owner

udayvunnam commented Jan 29, 2020

@patogalla is that working, upgrading to the latest xng-breadcrumb version

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants