-
Notifications
You must be signed in to change notification settings - Fork 3
Troubleshooting
By default all link clicks within the same origin are captured by middle-router, the default action is prevented, and the new url is routed as if route was called. The behavior can be turned off, when you call start: router.start({ routeLinks: false }).
If you didn't disable link routing in start, make sure that no other handlers called event.preventDefault(). A click event that was prevented won't trigger a navigation in middle-router, just as it doesn't trigger a normal navigation in the browser.
As of 2.0, middle-router doesn't listen to hashchange events, even when you are using hash routing. Some browsers will emit a popstate event when you programmatically change the hash, but not all major browsers behave this way.
If you want to navigate programmatically, instead of changing the hash (location.hash = '#/new/location'), you should call navigate (router.navigate('/new/location')). You can also replace the current history entry by calling router.replace.