-
Notifications
You must be signed in to change notification settings - Fork 159
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
Accessing the parent handler in model method (whilst transitioning) #26
Comments
In the new version of the router (#19), it's possible to pass the current handler's context to the next handler by decorating the transition with the context or by looking at the Anyhow, probably I should be closing this obscure question for now as I found a way to achieve it. However, I think it might be useful to expose the handleInfos of the transition on the transition, this way the parent handler could be read the same way as it's done in Ember for targetHandlerInfos. On the other hand, exposing that seems a bit dangerous:
So if the use case (for me anyway) is to be able to access the parent handler while transitioning (to access parent's data, which is used to figure out how to fetch child's data), then perhaps only the parentHandler reference should be exposed to each handler in the transition. I did find a way to do that as I've described in the first paragraph though, so I'm just documenting my thoughts.. and this issue can be closed. |
Hm, nope, still stuck on this one. I was using Ember's dsl for generating the routes, and a name for the nested resource doesn't contain the parent's name, so I still don't have a good way to access a parent handler im |
@KidkArolis is this still an issue for you? (rofl 2 years later) |
Nah, I moved on from router.js (... https://medium.com/@kidkarolis/sunday-coffeeshop-and-cherrytree-448614b5a02d) |
When my handler's model is called, I need to lookup the parent handler's context. I know you guys probably don't need to do that in Ember, but I was wondering if there was a way right now, without changing the code.
I saw the following function being used in Ember
But that will only work in activate or setup, where the router.targetHandlerInfos has already been set. Can this be achieved from
model
?The text was updated successfully, but these errors were encountered: