0

In an angular-router resolver's resolve method, is there a way to distinguish between (for lack of a better term) hard navigation (page-refreshes and first-visits within a session) and soft navigation (subsequent visits within a session by forward or backward traversal)?

Here's my scenario. I always need to fetch data from the server for hard navigation and I only occasionally need to fetch data from the server for soft navigation. More typically however for soft navigation I merely perform other tasks which don't entail interaction with the server but which do use parameter values from the route.

CalvinDale
  • 9,005
  • 5
  • 29
  • 38
  • I think the best approach then is to check whether you have the necessary data before you fetch it on resolve. – Avin Kavish Oct 16 '18 at 03:37
  • @AvinKavish Checking to see if the required data is already in memory before initiating a fetch from the server is similar to how I was thinking of solving this problem. One could use the server-parameters portion of the route as a key to the local memory store. However, I wonder if Angular provides some other mechanism. – CalvinDale Oct 16 '18 at 13:18

0 Answers0