Repository navigation
fix(router): expose reload method on ActivatedRoute resources - #70702
Merged
Merged
Conversation
Resources managed by the Angular Router implement a `reload(): boolean` method, but `ResourceResult` typed resources on `ActivatedRoute.resources` and `ActivatedRouteSnapshot.resources` as `Record<string, Resource<unknown>>`. This caused TypeScript errors when attempting to call `.reload()` without a type assertion. This commit updates `ResourceResult` to intersect each resource with `Pick<WritableResource<unknown>, 'reload'>` so that `.reload()` is properly typed. Fixes angular#70698
atscott
force-pushed
the
router-resource-reload
branch
from
September 11, 2026 19:57
3a6d609 to
dbbffde
Compare
JeanMeche
approved these changes
Sep 12, 2026
Contributor
|
I know the above comment about |
Contributor
Author
|
caretaker: please do public api review |
Contributor
Don't tell me what to do!! LOL OK fine. reviewed-for: public-api |
alan-agius4
approved these changes
Sep 21, 2026
alan-agius4
left a comment
Contributor
There was a problem hiding this comment.
Reviewed-for: dev-infra
Contributor
|
This PR was merged into the repository. The changes were merged into the following branches:
|
This was referenced Oct 11, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Resources managed by the Angular Router implement a
reload(): booleanmethod, butResourceResulttyped resources onActivatedRoute.resourcesandActivatedRouteSnapshot.resourcesasRecord<string, Resource<unknown>>. This caused TypeScript errors when attempting to call.reload()without a type assertion.This commit updates
ResourceResultto intersect each resource withPick<WritableResource<unknown>, 'reload'>so that.reload()is properly typed. Additionally,Route.resourcesnow also acceptsRecord<string, Resource<unknown>>to allow returning custom or read-only resources without areloadmethod.Fixes #70698