My router responds well to urls like: contacts/3 etc. (since the route in the mapping is contacts/:id)
But the contact-list renders hrefs like this: contacts?id=3
(How) can I configure the way the dynamic anchor binding is being rendered like: contacts/3 ?
and/or:
(How) can I configure the route mapping to respond to urls like: contacts?id=3 ?
Indeed: in my setup, this binding: route-href="route: contacts; params.bind: {id:contact.id}"
returns urls like this: #/contacts?id=3
I ‘fixed’ the issue for now by replacing the above binding with: href="#/contacts/${contact.id}"
Which returns the intended: #/contacts/3
But I prefer to use the correct binding, instead of my ugly hack…
(My setup consists of an Aurelia app, which I generated with the command dotnet new aurelia
in which I copy-pasted the code of the Aurelia Contact Manager Tutorial)
Hmm. route-href should produce contacts/3 since the route is defined as route: 'contacts/:id' in app.js. Have you checked to make sure the route is defined this way?