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

Browser refresh resets breadcrumb trail #100

Open
feelthesource opened this issue Jan 16, 2018 · 6 comments
Open

Browser refresh resets breadcrumb trail #100

feelthesource opened this issue Jan 16, 2018 · 6 comments

Comments

@feelthesource
Copy link

feelthesource commented Jan 16, 2018

When refreshing (browser refresh - F5) a page that contains a breadcrumb trail, the trail is lost.
If the breadcrumb trail includes a prefix, only the prefix is shown after the refresh.

I think this issue is caused by the breadcrumb component's ngOnInit method only setting up the prefix, instead of calling the generateBreadcrumbTrail method.

feelthesource added a commit to feelthesource/ng2-breadcrumb that referenced this issue Jan 16, 2018
ngOnInit now calls generateBreadcrumbTrail
@williamchristophercooley
Copy link

williamchristophercooley commented Feb 20, 2018

I'm having this issue with Ng5-Breadcrumb as well. I wonder when this fix will go out? +1

@YannickAWE
Copy link

YannickAWE commented Feb 24, 2018

Same problem for me with Ng5-Breadcrumb.

@CSantosM
Copy link

CSantosM commented Mar 23, 2018

Hello guys, I had the same issue but i have fixed.
The problem was in the ngOnInit function of breadcrum.component.ts execute this.router.events.
When a user refresh the page, there isn't a event, so the subcription of the router.events doesn't work and generateBreadcrumbTrail( ) isn't called.
My solution is that:

if (this.router.navigated) {
   this._urls.length = 0; //Fastest way to clear out array
   this.generateBreadcrumbTrail(this.router.routerState.snapshot.url);
   this._routerSubscription = this.router.events.subscribe( ... )
}

On this way, generateBreadcrumbTrail( ) will be called when refreshing is happend.

@pablochud
Copy link

Still have problem with ng-5 breadcrumbs, how to resolve that. I have seen there is PR waiting. #101

@Cromies
Copy link

Cromies commented Aug 9, 2018

I am using ng6-breadcrumbs and am having the same problem. is there a fix??

@marquesgabriel
Copy link

Hello guys, I had the same issue but i have fixed.
The problem was in the ngOnInit function of breadcrum.component.ts execute this.router.events.
When a user refresh the page, there isn't a event, so the subcription of the router.events doesn't work and generateBreadcrumbTrail( ) isn't called.
My solution is that:

if (this.router.navigated) {
   this._urls.length = 0; //Fastest way to clear out array
   this.generateBreadcrumbTrail(this.router.routerState.snapshot.url);
   this._routerSubscription = this.router.events.subscribe( ... )
}

On this way, generateBreadcrumbTrail( ) will be called when refreshing is happend.

Would this fix work for ng6-breadcrumbs too?

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

7 participants