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

Missing a way of accessing child routes #537

Closed
tbnovaes opened this issue Oct 17, 2017 · 1 comment
Closed

Missing a way of accessing child routes #537

tbnovaes opened this issue Oct 17, 2017 · 1 comment

Comments

@tbnovaes
Copy link

I'm submitting a bug report

  • Library Version:
    1.4.0

Please tell us about your environment:

  • Operating System:
    OSX 10.13

  • Node Version:
    8.1.3

  • NPM Version:
    5.4.2

  • JSPM OR Webpack AND Version
    aurelia-cli 0.31.3

  • Browser:
    all

  • Language:
    ESNext

Current behavior:
There is no way to access the child routes. If I use repeat.for="row of router.navigation", the only routes available are the main routes.

Expected/desired behavior:
Be able to access the children routes. For instance, if I want to create a top navbar with the parents, and list the children routes on a sidebar.

I would expect to be able to do something like

<ul repeat.for="row of router.navigation">
    <li repeat.for="child of row.children" if.bind="row.isActive"><a href.bind="child.href">${child.name}</a></li>
</ul>
  • What is the expected behavior?
    Be able to easily iterate on the children routes marked with nav:true

  • What is the motivation / use case for changing the behavior?
    Had to do it the other day to create a really simple menu using parent/child, and the only workaround was to bind the child route to the owningView. Which takes much more time, it is much harder to keep track when you have many routes, and generates duplicated code.

@gheoan
Copy link
Contributor

gheoan commented Oct 17, 2017

This has been discussed in #90.

@davismj davismj closed this as completed Nov 16, 2018
@davismj davismj reopened this Nov 16, 2018
@davismj davismj closed this as completed Nov 16, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants