This is an angular 2 component that creates a breadcrumb trail. It hooks into the angular2/router, to dynamically build up the crumb trail once a component is routed to.
MIT License
102
stars
81
forks
source link
Breadcrumb component doesn't have any URLs registred if it's called from child route #82
If breadcrumb component is called from template in child route <breadcrumb></breadcrumb> , where we have defined <router-outlet></router-outlet> it doesn't have any of URLs registred and therefore, breadcrumbs doesn't display anything. However if we navigate somewhere inside application, it's starts working.
For example here is the list of defined routes in application:
However if we would make same call inside ServicesComponent, which is child route which has registred other children routes, described issue will appear.
Why I would like to call it inside child components and not from the root direclty, is because I want to have breadcrumbs displaying it only there on Services components. Calling hideRoute(route: string) function from breadCrumbService can't help in this case since security pages have completely different HTML then services pages.
If breadcrumb component is called from template in child route
<breadcrumb></breadcrumb>
, where we have defined<router-outlet></router-outlet>
it doesn't have any of URLs registred and therefore, breadcrumbs doesn't display anything. However if we navigate somewhere inside application, it's starts working.For example here is the list of defined routes in application:
If we would call a breadcrumb component inside app,component.html, where we have first call of router-outlet everything will work:
However if we would make same call inside ServicesComponent, which is child route which has registred other children routes, described issue will appear.
Why I would like to call it inside child components and not from the root direclty, is because I want to have breadcrumbs displaying it only there on Services components. Calling hideRoute(route: string) function from breadCrumbService can't help in this case since security pages have completely different HTML then services pages.