https://github.com/angular/angular
Revision 000363eec58c777575fe7d12dd74407c7c8a77f8 authored by Andrew Scott on 13 April 2022, 17:07:11 UTC, committed by Dylan Hunn on 14 April 2022, 00:29:42 UTC
There are two functions which do the same thing and are meant to search
for the closest loaded config in the `ActivatedRouteSnapshot` parent
tree. These can be combined to reduce code duplication.

One difference in the current implementation is the early exit for the
implementation in `activate_routes` when `route.component` is defined.
This early exit takes advantage of the fact that the component must then
also have a `RouterOutlet`, which injects `ComponentFactoryResolver`,
which would end up being the same one as what would be found if we
continued to look up the parent tree. This is only a tiny optimization
that will actually break when we add `providers` as a feature to the
`Route` config. In this scenario, we _must_ find the correct injector
in the parent routes and cannot rely on a parent `RouterOutlet` since
there may be some route with a providers list in between.

PR Close #45613
1 parent e250db4
History
Tip revision: 000363eec58c777575fe7d12dd74407c7c8a77f8 authored by Andrew Scott on 13 April 2022, 17:07:11 UTC
refactor(router): combine functions for getting loaded config (#45613)
Tip revision: 000363e
File Mode Size
.circleci
.devcontainer
.github
.husky
.ng-dev
.vscode
.yarn
aio
devtools
docs
goldens
integration
modules
packages
scripts
third_party
tools
.bazelignore -rw-r--r-- 2.8 KB
.bazelrc -rw-r--r-- 6.7 KB
.bazelversion -rw-r--r-- 6 bytes
.clang-format -rw-r--r-- 73 bytes
.editorconfig -rw-r--r-- 245 bytes
.gitattributes -rw-r--r-- 240 bytes
.gitignore -rw-r--r-- 915 bytes
.gitmessage -rw-r--r-- 7.2 KB
.mailmap -rw-r--r-- 51 bytes
.npmrc -rw-r--r-- 21 bytes
.nvmrc -rw-r--r-- 8 bytes
.prettierrc -rw-r--r-- 157 bytes
.pullapprove.yml -rw-r--r-- 46.9 KB
.yarnrc -rw-r--r-- 130 bytes
BUILD.bazel -rw-r--r-- 2.2 KB
CHANGELOG.md -rw-r--r-- 1.0 MB
CODE_OF_CONDUCT.md -rw-r--r-- 1.1 KB
CONTRIBUTING.md -rw-r--r-- 15.9 KB
LICENSE -rw-r--r-- 1.1 KB
README.md -rw-r--r-- 4.7 KB
WORKSPACE -rw-r--r-- 5.0 KB
browser-providers.conf.js -rw-r--r-- 1.8 KB
gulpfile.js -rw-r--r-- 631 bytes
karma-js.conf.js -rw-r--r-- 6.0 KB
package.json -rw-r--r-- 9.3 KB
renovate.json -rw-r--r-- 2.5 KB
test-events.js -rw-r--r-- 259 bytes
tsconfig-tslint.json -rw-r--r-- 171 bytes
tslint.json -rw-r--r-- 5.4 KB
yarn.lock -rw-r--r-- 705.9 KB
yarn.lock.readme.md -rw-r--r-- 1.3 KB

README.md

back to top