Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

beforeModel receives incorrect params during redirect #3407

Closed
ef4 opened this issue Sep 12, 2013 · 4 comments
Closed

beforeModel receives incorrect params during redirect #3407

ef4 opened this issue Sep 12, 2013 · 4 comments
Assignees
Labels

Comments

@ef4
Copy link
Contributor

ef4 commented Sep 12, 2013

Here's a minimal JSBin that demonstrates the problem:

http://jsbin.com/iZArAs/2/edit?html,js,output

Click between "One" and "Two". You'll see that the beforeModel hook fires twice during each transition, and the second time it fires with incorrect params (it receives the params of the current route, not the new destination route).

Ideally it would not fire twice (see #3056 ). But as long as it's going to fire twice, it needs to at least fire with the correct parameters.

@ghost ghost assigned machty Sep 26, 2013
@machty
Copy link
Contributor

machty commented Oct 28, 2013

Sorry this has been so inactive for so long; I'm working on router params stuff right now and this does seem related to some other problems I've noticed.

@machty
Copy link
Contributor

machty commented Nov 29, 2013

Update: tests are passing for this in my router.js refactor: https://github.com/tildeio/router.js/blob/refactor/tests/tests.js#L3197

@machty
Copy link
Contributor

machty commented Nov 29, 2013

fwiw the solution will be to not refire beforeModel hook.

@machty
Copy link
Contributor

machty commented Jan 2, 2014

Fixed by #4008

@machty machty closed this as completed Jan 2, 2014
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants