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

Navigating to non-empty child route fails when parent route is empty #525

Open
gheoan opened this issue Sep 27, 2017 · 3 comments
Open

Navigating to non-empty child route fails when parent route is empty #525

gheoan opened this issue Sep 27, 2017 · 3 comments

Comments

@gheoan
Copy link
Contributor

gheoan commented Sep 27, 2017

I'm submitting a bug report

  • Library Version:
    1.3.0

Please tell us about your environment:

  • Browser:
    Tested in latest Chrome, Firefox

  • Language:
    all

Current behavior:
Consider this configuration:

  configureRouter(config) {
    config.mapRoute({
      route: '',
      moduleId: 'child',
    });
  }
// child.js
export default class {
  configureRouter(config) {
    config.mapRoute({
      route: 'test',
      moduleId: 'test',
    });
  }
}

Navigating to /test fails with error route not found.
Here is a demonstration: https://gist.run/?id=929bcf7c2c64fbf6c9e3f2b6f7e797ab.
Seems like this is similar to #27.

Expected/desired behavior:

  • What is the expected behavior?
    /test should match the only child route from the example above.
@gheoan
Copy link
Contributor Author

gheoan commented Oct 2, 2017

Here is a reproduction using the latest aurelia libraries: https://github.com/gheoan/aurelia-router-issue-525.

gheoan added a commit to gheoan/router that referenced this issue Oct 4, 2017
gheoan added a commit to gheoan/router that referenced this issue Oct 5, 2017
gheoan added a commit to gheoan/router that referenced this issue Oct 5, 2017
gheoan added a commit to gheoan/router that referenced this issue Oct 5, 2017
@Alexander-Taran
Copy link
Contributor

http://aurelia.io/docs/routing/configuration#redirecting-routes

The redirect is particularly useful when you have an "empty" route pattern (such as the first route above) that maps to a component with a child router. In this case, create a non-empty route and then redirect the empty route to the non-empty route (as above). This will enable the child router to consistently match child routes without getting confused in scenarios where the empty route was matched.

seems like all the threads about empty parent routes end there

maybe can be closed

@Alexander-Taran
Copy link
Contributor

@davismj (-:

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

4 participants