First and foremost, here’s a stackblitz of the issue I’m facing.
Let’s say I have a route in my application that looks like /projects/{projectId}/files/{fileId}
.
I have a projectResolver
defined at the /projects/{projectId}
route (and subsequent child routes) that will call the API and load the project data.
I have a second fileResolver
defined at the /projects/{projectId}/files/{fileId}
to load the specific file from the API. However, in order to load that file, I need information defined on the project object that’s resolved from the projectResolver
.
When I try to access the route, I can see the project
endpoints being called, and object is resolved. However, if I try to access that project from the activatedRouteSnapshot.data
in the fileResolver
, the data is not present.
Is there a way to access data from other resolvers “higher up” in the route chain?