-
-
Notifications
You must be signed in to change notification settings - Fork 115
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
Route Generation for route in another hierarchy #625
Comments
cc @davismj I think it's been a long time feature request |
If you're looking for a time-effective solution, can you just generate the route by hand? That will be your best bet. <a href="#/audio/${id}"></a> If you're using child routers, you can't really do it easily. If you navigate to client-detail and the route information lives in audio-shell, and you've never loaded audio-shell, the information is just not there to generate the route. If you're not using child routers, you should use route-href, and you can use If you're dead set on having Aurelia libraries generate the route for you the way they do for non-child routes, it would look something like this: https://codesandbox.io/s/p3869rrwz7. However, this is just a complicated way of solving the problem. You'll probably have less of a headache building the route by hand. To add, @bigopon ? |
Thanks @davismj this was basically the conclusion I had come to, just wanted to make sure I hadn't missed anything. Yes we are using child routers (and wouldn't want to change that as they are great). you've never loaded audio-shell, the information is just not there to generate the route - does this mean that if I had already visited audio-shell this would be possible? Isn't the information about that hierarchy lost as soon as I leave? Has there ever been any thought or discussion about functionality to enable providing route hierarchies up front that still support child routing (some sort of tree structure where the nodes are module defs)? In my case the two features would understand up front their own hierarchies and could export that to be loaded by the root router at app start up. Then during navigation that tree could be used in place of |
@simonfox Theoretically, after every navigation, the whole mapping table of every branches from every child router can be aggregated into a giant single table. But I don't think it's something can be added easily for current router code base. Maybe it will be easier after TS conversion. |
cc @bigopon (from Gitter)
I'm looking for a way, or at least some router internals that might help, to generate a route from one hierarchy to another.
As a simplified example, assume the following hierarchy
Assume
client-detail
is the active route, I want to generate a route (or navigate) to theaudio-detail
route.I'm currently doing this by defining a route builder module in the audio feature which is exported and used by the client feature. This module understands the route table of the feature and can build a fragment for consumers. I'm just wondering if there is anything existing I can use to support doing something like this?
The text was updated successfully, but these errors were encountered: