Closed dhritzkiv closed 9 years ago
have you tried router.navigate('/contact', {trigger: true})
?
Yep, have tried that. The router seems to know that it's already on /contact
and doesn't do anything as a result.
Dirty, but working way of doing this app.router[app.router.routes['/contact']]()
Yep you're right, didn't see that line https://github.com/AmpersandJS/ampersand-router/blob/master/ampersand-history.js#L186
try router.history.loadURL(router.history.fragment)
This could definitely be a new function in the router imo.
Even if one of those suggestions works I'm gonna repurpose this issue as a feature request.
Ah, much better than my solution of appending a random query string to the end. But yes, a specific flag (or other, more obvious mechanism) would be welcome. Thanks!
@dhritzkiv did either of those work? I'd love to hear if the router.history.loadURL(router.history.fragment) worked cause that's an easy thing to throw into a function in the router.
@wraithgar Yes, it did! (though the function name on router.history
is loadUrl
, and not loadURL
).
reload()
now exists.
Say I am on the page
/contact
. Is there anyway to force the router to trigger the path to load again if I runrouter.navigate('/contact')
? Currently, the router doesn't fire the route callback if it's already on that route (which is useful 95% of the time)