I have set up my Aurelia Router in app.ts using the configureRouter function like this:
configureRouter(config, router: Router) {
config.map([
{
route: ['users', 'users/:userId?'],
name: 'users',
moduleId: './users',
nav: true,
},
//…
])
}
Later on in my code, I use the Router to navigate to a specific user like so:
showUser(id: number) {
const params = { userId: id };
this.router.navigateToRoute("users", params);
}
This method was working perfectly until recently, producing #/users/1
. However, after updating npm from aurelia-cli@1beta3 to aurelia-cli@1beta5, it now generates #/users?userId=1
and fails to navigate.
Any idea what might be causing this issue?