Closed jokesterfr closed 9 years ago
The router considers a path a hash path if the hash starts with #/
. All other cases it thinks it's a regular path. You can force the router to use the hash for paths at all times with this:
<app-router pathType="hash" trailingSlash="ignore">
I think this should do it. Let me know!
Thank you @erikringsmuth for the quick answer! This works better, as cases 3 and 7 now work, but 4 and 8 are still wrong. I feel I can do a manual hash change while loading index.html page, isn't it supported by app-router itself?
Example of what could change it:
window.location.hash = '/';
I've avoided adding redirects so far but that's something I should tackle at some point. I'll add a few of these as test cases and that should help me work out what's going on with 4 and 8.
Hi, thank you for publishing this module, it sounds very promising. I'm trying to use it, and I'm facing a little issue. Here is my
index.html
file using app-router:My webapp is hosted under http://localhost:8080/test/index.html, and my concern is about getting the home page in those cases:
Cases 1-2-5-6 give me the home-page (as expected) Cases 3-4-7-8 give me the not-found-page (not expected)
Do you have any clue why isn't app-router targeting the home page when no hash is given?
FYI my server.js is:
Thank you, Jk.