Here is an innovative, untested approach that I have devised:
To configure your routes for the home page (assuming the URL is /home
), include the following parameters:
{
// ...
reloadOnSearch: true,
redirectTo: function (routeParams, path, search) {
if (search.redirected) {
// Do not redirect, return the same path + search
return '/home?redirected=true';
} else {
return '/home';
},
// ...
}
The concept behind this solution is that when you link to /home
, the redirectTo()
function will trigger and redirect you to /home?redirected=true
. This change in the search parameter allows the route to reload correctly as reloadOnSearch: true
is specified. As the links to the home page always point to /home
, the page should always reload.
While this method may not be the most elegant and may result in the home page controller running twice when transitioning from another page back to the home page, it could be worth experimenting with if no other solutions seem to work.