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,
This does not answer your exact question which is how to force a reload of the current view, but have you considered adding the current company identifier to your route(s)? This will solve your problem and make your routes bookmarkable: ie: /#/company1/view1
and /#/company2/view1
. When you change the company in the drop-down you call router.navigate()
with the new route and the new view will be loaded/refreshed.
To answer your exact question, I tested the router.navigate
options: router.navigate('myroute', {replace:true, trigger:true})
and none of them force a reload of the view if the right view is already loaded. By appending ?ramdomNumber
to your route name you can force a reactivation of the view.