You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
HTML5LocationStrategy fails to update path on router.navigate #3096
It appears that only the HashLocationStrategy updates the url on calls to router.navigate. When I change my LocationStrategy to the HTML5LocationStrategy the urls no longer update when navigating from "/products/:productId" -> "/". The navigation does occur, though.
Thanks for the tip. I just added a base tag and it works now. Is that always going to be required for the HTML5 Strategy? Not exactly hard to add to the page, so, not that big of a deal.
Currently the router uses document.baseURI to determine the base URI. I think it might be better to remove this option entirely and make the app base href binding required.
Activity
Zyzle commentedon Jul 16, 2015
Does your entry point page specify a
<base>tag? I found similar behaviour a few milestones back (~28 I think) when my app didn't have the base tag.Edit: Just went back and tried this in my app and yes removing the base tag causes this issue.
Navigation between routes works however attempting to go back to the
/route updates the page components but not the URLbryantharpe commentedon Jul 16, 2015
Thanks for the tip. I just added a base tag and it works now. Is that always going to be required for the HTML5 Strategy? Not exactly hard to add to the page, so, not that big of a deal.
btford commentedon Jul 17, 2015
@bryantharpe you either have to add a
<base>tag or set an app base href like this: https://github.com/angular/angular/blob/master/modules/angular2/test/router/router_integration_spec.ts#L78-L90Currently the router uses
document.baseURIto determine the base URI. I think it might be better to remove this option entirely and make the app base href binding required.bryantharpe commentedon Jul 17, 2015
Thanks for the input @btford That makes more sense, I went ahead and updated my code to work like that.
chore: update to Angular 2.0.0-alpha.32
angular-automatic-lock-bot commentedon Sep 6, 2019
This issue has been automatically locked due to inactivity.
Please file a new issue if you are encountering a similar or related problem.
Read more about our automatic conversation locking policy.
This action has been performed automatically by a bot.