-
Notifications
You must be signed in to change notification settings - Fork 20
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
go-header-bar component does not display its contents when navigated to the same component. #571
Comments
Hey @sudheepdivakargithub, in Angular when a navigation event is fired that targets the same route that is active, Angular will not re-render the component by default. I am curious what could be causing this. Can you provide any code examples that could explain why this might be happening in your case? |
Hi Graham, please refer https://stackblitz.com/edit/angular-ivy-dfgmuq to reproduce this issue.
One thing to note is in the template with goHeaderBar directive we render buttons dynamically. |
Thanks for that replication @sudheepdivakargithub! That helped. I removed a bunch of stuff from the stackblitz just to get to the base issue, but I believe it has something to do with how the Because of the way routing is being used here Angular will trigger a page refresh for the component, even though it's the same component being used and just a different param. This probably doesn't need to happen and I've been able to create a work-around until we can find a resolution to this bug. For the buttons that perform the routing in the
Instead of:
|
@sudheepdivakargithub here is the fork of your recreation with a working example: https://stackblitz.com/edit/goponents-header-bar-disappearing |
@sudheepdivakargithub I figured out why this was happening in Goponents, although I am not sure of a way to actually bypass this. If we remove this line the previous page's header-bar would appear on the next page, even if that page didn't have a header-bar declared. I'll need to think on this. The issue:
|
@sudheepdivakargithub, did this fork solve your issue?
Doing this: this.router
.navigateByUrl('/', { skipLocationChange: true })
.then(() => {
this.router.navigate(['detail', 200])
}); Instead of this: this.router.navigate(["/detail", 100]); |
Closing this issue as it was fixed as a part of #581 |
Describe the bug
When the app navigates to the same component, the go-header-bar component does not display its content.
To Reproduce
Steps to reproduce the behavior:
Expected behavior
go-header-bar should display the content supplied.
Screenshots
If applicable, add screenshots to help explain your problem.
The text was updated successfully, but these errors were encountered: