Running into an issue where if I refresh the page while on an interior route, my app will reload with the interior route loaded in front of the root url in the URL address bar. In other words, if the root route is http://localhost:3000/root, and then I navigate to the "about" component (http://localhost:3000/about) and then refresh the page, I end up with http://localhost:3000/about/root. What do I need to change in my routing to address this?
-
1how should we know what you need to change if you don't post your code?smnbbrv– smnbbrv2016年11月11日 23:56:51 +00:00Commented Nov 11, 2016 at 23:56
1 Answer 1
After a little more research, I realized this happened after I changed my "useHash" setting in the root module. In order to resolve the issue I just had to change "RouterModule.forRoot(routes, {useHash: false})" to "RouterModule.forRoot(routes, {useHash: true}).