2015-09-13

I am not sure if I understand well the situation with pushstate and routing but I am stuck trying to route a single page app using either pagejs or grapnel or other similar javascript routers.

My problem:
If I don't use pushstate then I can navigate manually from the location bar to /#login and from a url in an html page pointing to it.

If I use pushstate then this doesn't work so that if I enter /#login or /#blabla I get the same routing to the / route, but I am supposed to be able to do router.navigate('/login') (that is what pushstate is for right?).

I have also made my nodejs backend to redirect to /#login if it gets a request for /login.

How can I utilize pushstate so that I can both enter a manual address in the location bar and navigate through it from the router and html links?
What am I missing here?

Show more