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

[Request] Dynamic routing? #321

Open
ramon18 opened this issue Oct 18, 2015 · 0 comments
Open

[Request] Dynamic routing? #321

ramon18 opened this issue Oct 18, 2015 · 0 comments

Comments

@ramon18
Copy link

ramon18 commented Oct 18, 2015

I've been looking for a solution to support dynamic routing.

My objective is to gather from server the main modules and initialize router with a basic routing table, ex:
{
'/mod1': function() {...},
'/mod2': function() {...},
'/mod3': function() {...},
}

When the user access a module, the module definition dynamically loads from the server and some magic happens by calling router.mount to add additional routings for that module.
So far so good, when the user interact with the module, routing works just perfectly.

The problem:

  1. User navigated inside the module 'mod1' and reached the hash http://localhost/#mod1/settings
  2. User press F5
  3. notfound is called because routing '/mod1/settings' is not yet known.

Is there any trick to make this work?
One possible solution would be support async partial matching to allow module to be instantiated during dispatch.

Thanks in advance.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant