gmostert / ng2-breadcrumb

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

Move router subscription to constructor #77

Open hardraid opened 7 years ago

hardraid commented 7 years ago

Hi Gerhard, I created this PR because recently I updated my Angular instance to 4.1 and found an issue when you load the page for first time and Breadcrumb doesn't show because NavigationEnd executes before ngOnInit. Please check it for your own aware and ensure if this changes are correct.

Thanks!

Bidthedog commented 7 years ago

I can confirm this works for my use-case too

lukaszklis commented 7 years ago

Same here, can reproduce the same issue with Angular 4.1+

doublevcp commented 7 years ago

I have the same issue with Angular 4.1.

evanjmg commented 7 years ago

@gmostert Can you merge this? It helps with reliability of the breadcrumbs

spwizard commented 7 years ago

Any idea when this may be merged in or any other possible work around

TomMettam commented 6 years ago

Any chance of getting this merged?

TomMettam commented 6 years ago

Actually, there's an issue with this and the prefix option - on the initial page load, it shows the prefix twice.

Bidthedog commented 6 years ago

@TomMettam I'm also getting this - using it in a different project and now see double "home" links when in use. If I DON'T use the prefix option, I get no links for home.

garrylachman commented 6 years ago

Please merge...

garrylachman commented 6 years ago

as workaround untill merge, change in package.json: "ng2-breadcrumb": "https://github.com/hardraid/ng2-breadcrumb"

works for me

marklreyes commented 6 years ago

@gmostert Please approve this PR and merge back. Like everyone else, I upgraded recently from Angular 2 to 4 (2.4 to 4.4, specifically) and notice the empty breadcrumb trail on initial page load.