Any chance we can get support for a call that looks something like this?
// does not add an entry into the browser history
router.replaceRoute('/new/route');
Under the hood, director is using window.pushState() on the router.setRoute() call which will push a new entry onto the window history stack. This makes the native browser history inflexible in certain cases.
eg. if i only want to change query params (user isn't taken to new page)
previous url: example.com/home
current url: example.com/new/route
router.setRoute('/new/route?new=true');
Now, if the user clicks back button, they'll be taken to example.com/new/route which is the same page sans any query param filter. I would like the control to navigate them back to example.com/home instead.
Also, this has been requested by a few of people:
flatiron#316
Any chance we can get support for a call that looks something like this?
Under the hood, director is using
window.pushState()on therouter.setRoute()call which will push a new entry onto the window history stack. This makes the native browser history inflexible in certain cases.eg. if i only want to change query params (user isn't taken to new page)
previous url:
example.com/homecurrent url:
example.com/new/routerouter.setRoute('/new/route?new=true');Now, if the user clicks back button, they'll be taken to
example.com/new/routewhich is the same page sans any query param filter. I would like the control to navigate them back toexample.com/homeinstead.Also, this has been requested by a few of people:
flatiron#316