0

I 'always' want to reload my resolver and only ignoring the reload when a fragment is set (ex: URL/xxx?yyy#FRAGMENTHERE)

Am I missing something or is it not possible in Angular ?

Here is what I tried :

in app-routing-module.ts

...
onSameUrlNavigation: 'reload',
...

in XXX-routing-module.ts

Test 1:

...
runGuardsAndResolvers: 'always' as RunGuardsAndResolvers,
...

This one is not working because when a fragment changes, the resolver is called

Test 2,3,4:

runGuardsAndResolvers: 'pathParamsOrQueryParamsChange' as RunGuardsAndResolvers,
runGuardsAndResolvers: 'paramsOrQueryParamsChange' as RunGuardsAndResolvers,
runGuardsAndResolvers: 'paramsChange' as RunGuardsAndResolvers,

Thoses ones are not working because if I'm trying to reload on the same URL it's not calling the resolver

PS : The navigate looks like this

this.router.navigate([], {
     queryParamsHandling: 'merge',
     queryParams: {
         ProgramState: ProgramState.Reading,
         Session: 0,
     }
});
bmtheo
  • 974
  • 1
  • 7
  • 16
  • Do you have any solution to your problem? I have some issue similar to yours – IsraGab Jul 06 '20 at 14:02
  • I wish I found something but no, for now I use a workaround : I added a variable "ForceReload" and the value is Math.random() – bmtheo Jul 07 '20 at 15:12

0 Answers0