Repository navigation
Conversation
Currently, the `Router` will create the `EnvironmentInjector` for a `Route` with `providers` as soon as it _attempts_ to match segments to the `Route`. Instead, this change updates the logic to only create the injector once we have confirmed that the `Route` matches. Note that this will include partial matches where the final navigation still fails with a "cannot match any routes to segment" error. We need to maintain the injector hierarchy so we still need to create parent injectors before descending into the child routes and determining if there is a full match or just a partial one. resolves angular#45988
atscott
force-pushed
the
onlyCreateRouteInjectorOnMatch
branch
from
May 13, 2022 17:39
5ee17b8 to
3b974e9
Compare
alxhub
approved these changes
May 13, 2022
Contributor
Author
Contributor
|
This PR was merged into the repository by commit 4d2e006. |
jessicajaniuk
pushed a commit
that referenced
this pull request
May 13, 2022
…hes (#45990) Currently, the `Router` will create the `EnvironmentInjector` for a `Route` with `providers` as soon as it _attempts_ to match segments to the `Route`. Instead, this change updates the logic to only create the injector once we have confirmed that the `Route` matches. Note that this will include partial matches where the final navigation still fails with a "cannot match any routes to segment" error. We need to maintain the injector hierarchy so we still need to create parent injectors before descending into the child routes and determining if there is a full match or just a partial one. resolves #45988 PR Close #45990
|
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
Currently, the
Routerwill create theEnvironmentInjectorfor aRoutewithprovidersas soon as it attempts to match segments tothe
Route. Instead, this change updates the logic to only create theinjector once we have confirmed that the
Routematches. Note that thiswill include partial matches where the final navigation still fails with
a "cannot match any routes to segment" error. We need to maintain the
injector hierarchy so we still need to create parent injectors before
descending into the child routes and determining if there is a full
match or just a partial one.
resolves #45988