iron-meteor/iron-location

replaceState support

zimme opened this issue · 7 comments

I was using Router.go('route', {}, {replaceState: true}); in my auth hook

I'm currently rewriting it to support 1.0.0 and now the replaceState option don't go through.
I was using replaceState to keep the login page out of the history.

I was looking through the src and didn't see any support for replaceState.

The replaceState function in historyState branch seems to only replace the historyState object for the current url.

Oops, need to add this back.

On Oct 6, 2014, at 5:31 AM, Simon Fridlund notifications@github.com wrote:

I was using Router.go('route', {}, {replaceState: true}); in my auth hook

I'm currently rewriting it to support 1.0.0 and now the replaceState option don't go through.
I was using replaceState to keep the login page out of the history.

I was looking through the src and didn't see any support for replaceState.

The replaceState function in historyState branch seems to only replace the historyState object for the current url.


Reply to this email directly or view it on GitHub.

On a side note, is there a way to pass data between routes without using Session or uri query?

i.e. set a state variable on the controller I'm redirecting to?

I'm looking around to see if there's a way I can skip using 'iron-router-auth.route' session var with the route I redirected from.

@zimme I can't recall if it works in IR1.0 yet but you used to be able to call Router.go(...., {foo: bar}) and have options.foo set on the new controller.

Ok, but won't that set the uri query part? unless foo is in the route regex i.e. /route/:foo it will be /route?foo=value?

I'll try it out, thanks

If it don't work I'll just continue using Session for now =)

@zimme - no a third parameter -- so Router.go('name', params, options)

74e1252 closes this, thanks