I have an Aurelia application where the user can select the company they\'re currently \"working on\". Every page in the app is dependent on the currently selected company,
Better answer:
this.router.navigateToRoute(
this.router.currentInstruction.config.name,
{
...this.router.currentInstruction.params,
reload: Number(this.router.currentInstruction.queryParams.reload || 0) + 1,
},
{ trigger: true },
);
The navigateToRoute()
takes 3 parameters:
trigger: true
option forces an activationStrategy: invokeLifecycle
on this specific routing instruction without the need to set this option in the viewModel or routeConfig for normal routing.