router
router copied to clipboard
route-href docs is missing
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
I would also expect navigateToRoute
and generate
to be part of the main router docs.
@CasiOo This is something that @HIRANO-Satoshi has brought up with me (a long time ago). I totally agree! It's just finding time.
Yes, thanks.
There is some doc for router configuration but not for its usage at all in the main docs.
@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.
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.
Thanks, but no. My problem was solved by if.bind="pID_value" as described at https://github.com/aurelia/router/issues/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?
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.
@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
I see. Maybe my aurelia-router is 1.6.3 and too old.
@bigopen We have a background story. I'm respecting his Promise.