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

route-href docs is missing #595

Open
CasiOo opened this issue May 10, 2018 · 9 comments
Open

route-href docs is missing #595

CasiOo opened this issue May 10, 2018 · 9 comments
Assignees

Comments

@CasiOo
Copy link

CasiOo commented May 10, 2018

Documentation for route-href is missing https://aurelia.io/docs/routing
The attribute is mentioned in the Cheat sheet, but should also be documented in the main router docs https://aurelia.io/docs/fundamentals/cheat-sheet#routing

@CasiOo
Copy link
Author

CasiOo commented May 10, 2018

I would also expect navigateToRoute and generate to be part of the main router docs.

@davismj
Copy link
Member

davismj commented May 12, 2018

@CasiOo This is something that @HIRANO-Satoshi has brought up with me (a long time ago). I totally agree! It's just finding time.

@davismj davismj self-assigned this May 12, 2018
@HIRANO-Satoshi
Copy link
Contributor

Yes, thanks.

There is some doc for router configuration but not for its usage at all in the main docs.

@HIRANO-Satoshi
Copy link
Contributor

@davismj or somebody Could you give this issue some more priority?

I am confused with an error message, but there is no explanation on route-href.

ERROR [route-href] Error: A value is required for route parameter 'pID' in route 'a-list'.

Docs for navigateToRoute(), navigate(), navigateBack() are also needed.

@davismj
Copy link
Member

davismj commented Jun 12, 2019

You have configured a route { route: 'path/to/route/:pID', name: 'a-list' }. You have a link <a route-href="a-list">. It doesn't know how to make the href because you haven't provided a pID. Instead, write this: <a route-href="route: a-list, params.bind: { pID: 123 }">. Then, it will generate href="path/to/route/123".

Does that make sense?

Sorry about the documentation shortage.

@HIRANO-Satoshi
Copy link
Contributor

Thanks, but no. My problem was solved by if.bind="pID_value" as described at #203.

It must be a common pit hole. We need a real document that covers all about how to use the routing.
We would really appreciate if you could have time for it.

  • patterns for activating routing

    • <a href="" or <a href.bind=""
    • <a route-href="
    • router.generate()
    • router.navigateToRoute()
    • router.navigateBack()
      (there are examples at cheatsheet's "Generating Route URLs")
  • explanation of <a href="" or <a href.bind=""

  • explanation of <a route-href="

    • if.bind="value" pattern to avoid the "A value is required for route parameter" error.
  • explanation of router.generate()
    ...

Anything else? Are there routing events? hooks?

@davismj
Copy link
Member

davismj commented Jun 12, 2019

The if.bind thing was resolved. If you're still seeing this issue there's probably a deeper issue. You should never need an if.bind for this case.

@bigopon
Copy link
Member

bigopon commented Jun 12, 2019

@davismj what @HIRANO-Satoshi meant I think is the need for doc to cover various scenarios, common errors and how to resolve them.

@HIRANO-Satoshi since you are aware most of them, would you like to give it a try? Others would love it like you do

@HIRANO-Satoshi
Copy link
Contributor

I see. Maybe my aurelia-router is 1.6.3 and too old.

@bigopen We have a background story. I'm respecting his Promise.

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

4 participants