I have some routes like so:
{
route: "/sessions/:sid?",
nav: true,
name: "sessions",
moduleId: ...,
href: "/sessions"
},
{
route: "/sessions/:sid/jurors",
nav: false,
name: "sessionjurors",
moduleId: ...
},
{
route: "/sessions/:sid/cases/:cid?",
nav: false,
name: "cases",
moduleId: ...
}
Notice the last route – “cases”. My understanding is that because I have an optional parameter, I’m also required to provide an href value (like I did with “sessions”). However, the “base” href value requires a session id (sid).
Is there a way to configure this or get this working with Aurelia routing?
Note
Incidentally, I tried doing the following:
...
{
route: "/sessions/:sid/cases/:cid?",
name: "cases",
nav: false,
moduleId: ...,
href: "/sessions"
},
{
route: "/sessions/:sid/cases/:cid/jurors",
name: "casejurors",
nav: false,
moduleId: ...
}
Notice the base href set to “sessions”. This satisfied the need for the href, but it failed when trying to navigate from casejurors back to cases. The navigation acted really weird. The first click of the back arrow left me sitting at casejurors. The second click of the back arrow took me all the way back to sessions instead of to cases.