619 Commits

Author SHA1 Message Date
Paul Gschwendtner 09280257a2 build: clean up references to old master branch (#45890)
Cleans up all references to the `master` branch we renamed to
`main` across Angular.

PR Close #45890
2022-05-05 10:53:13 -07:00
Joe Martin (Crowdstaffing) 61894570f1 docs: improve markdown (#45590)
improve markdown for documentation. Duplicate of #45325 that targets 13.3.x.

PR Close #45590
2022-04-11 22:35:01 +00:00
Mike cc90fd55b2 docs(router): Fix typo on segments (#45411)
PR Close #45411
2022-03-24 10:49:36 -07:00
Andrew Scott 6336b8e5b3 refactor(router): Make a few adjustments to createUrlTree for clarity (#45306)
* `tree` function now accepts the old root rather than the old
  `UrlTree`. The `urlTree` argument was only used to get the `root`.
  This change makes it more clear what that pararmeter is used for and
  what's actually being used
* Move the `oldRoot` (previously `urlTree`) to be the first argument of `tree`.
  This change now mirrors the argument order for `replaceSegment` and
  can be read from left to right more easily "in this root,
  replace this old segment group with this new segment group".
* Extract `newRoot` to a variable. This just makes it more clear what's
  going on at the end rather than combining a bunch of operations into
  one.

These changes are being made so that hopefully a future refactor can be
done which does not rely on the `urlTree` argument at all in the
`createUrlTree` function. These refactorings will make it easier to see
1:1 functionlity in these various places.

PR Close #45306
2022-03-09 13:52:38 -08:00
Andrew Scott de67c9fd01 refactor(router): Use helper function to throw NoMatch (#45244)
This update matches the other locations where noMatch is thrown.

PR Close #45244
2022-03-04 15:24:14 -08:00
Andrew Scott e16dab82a1 refactor(router): Remove special logic for hybrid apps (#45240)
This commit removes special (undocumented) logic in the Router code that is
meant to prevent duplicate navigations that result from location syncs in
AngularJS/Angular hybrid applications.

The duplicate navigations can occur when both the Router and the AngularJS sync
code detect a location change via a popstate/hashchange event. When this
happens, the Angular Router schedules a navigation to sync itself with
the browser, but the hybrid listener may also schedule an additional
navigation. There are a few reasons this logic should not be included in
the Router:

* This special logic is not tree shakeable so it introduces a bundle
  size cost for all applications, most of which don't need it.
* There have been many updates to the routing pipeline to tolerate
  duplicate navigations. That is, duplicate navigations can happen and
  routing should still complete successfully.
    * https://github.com/angular/angular/commit/0e8548f667e5fdefa3ac7cdf1ba47e3e17011ffc
    * https://github.com/angular/angular/commit/9e039ca68bfae5328f3fc1f16fabd7673c466a25
* The logic is really in the wrong place: The hybrid sync code should be
  the location to handle this. If duplicate navigations are meant to be
  avoided, the hybrid sync code should have handling to _not_ trigger
  duplicate navs.
* This logic _also_ used to exist because the mock location
  helper used for test incorrectly triggered popstate events during
  router navigations. In order to avoid unexpected behavior in tests, this
  logic needed to be added. This incorrect mocking may also have been
  put in place because the upgrade module _would_ see a location change
  event and trigger a duplicate navigation.  The location mock has since been updated to
  match real browser behavior so this is no longer necessary. The
  upgrade module has also been updated to not trigger duplicate
  navigations.  The following commits are related to this:
    * https://github.com/angular/angular/commit/202a1a56314af4ddb99c476f974536a10e390319
    * https://github.com/angular/angular/commit/c6a93001eb74374b0fbc6aea1286fe1183d21382

Side note: The `setTimeout` in the location change listener is used to
ensure the ordering of duplicate navigations was consistent. You can see
that the logic being removed here expects the imperative navigation to precede the
popstate/hashchange. With the removal of this code, the `setTimeout` no
longer serves a purpose. However, it has been found that tests can rely
on this behavior (incorrectly) because they expect the navigation to be
complete but in reality, it hasn't even started because the test has not
flushed the timeout. Removing the timeout would be a breaking change as
a result.

PR Close #45240
2022-03-03 09:14:39 -08:00
Andrew Scott 01fde59dd9 refactor(router): Refactor errors in applyRedirects to use common throwError function (#45170)
The implementation of `throwError` in `rxjs` is identical to what is
done manually in the Router code.

PR Close #45170
2022-02-24 23:50:01 +00:00
Andrew Scott a4debf14e3 refactor(router): Update match result to be more explicit (#45170)
The `lastChild` property in the match result is only used to compute the
remaining segments (i.e. the ones which were not consumed). The updated
type here makes it easier to use and more clear.

PR Close #45170
2022-02-24 23:50:01 +00:00
Andrew Kushnir d40ac2056e refactor(core): drop all .ngfactory and .ngsummary imports (#44957)
This commit updates various places in the repo (mostly tests/examples) to drop all `.ngfactory` and `.ngsummary` imports as they are no longer needed in Ivy.

PR Close #44957
2022-02-07 15:31:49 -08:00
Andrew Scott b9aab0c87b fix(upgrade): Do not trigger duplicate navigation events from Angular Router (#43441)
This code mimics behavior that Google Analytics has been using to
prevent duplicate navigations. They set up their own `HybridRoutingService`
location sync to avoid duplicate navigations that came from the Angular
router. This would happen because the Angular router would trigger a
navigation, which would then get picked up by the `$locationShim`, which
would trigger a `$locationChangeStart`, which would then be picked up by
the `setUpLocationSync` watcher here, which would again trigger a
navigation in the Angular Router.

All of this can be prevented by checking if the `navigationId` exists on
the history state object. This property is added by the Angular router
during navigations.

fixes #21610

PR Close #43441
2022-02-02 19:51:20 +00:00
Andrew Scott 123f42c744 test(upgrade): update router upgrade tests to use fewer mocks (#43441)
This updates the router upgrade tests to use less mocked behavior. The
test upgrade location module is copied from the one that's used in the
common package. This update to the tests verifies more real behavior of
the upgrade module.

PR Close #43441
2022-02-02 19:51:20 +00:00
markostanimirovic ec49796807 docs(router): provide better typing for resolver example (#44932)
PR Close #44932
2022-02-01 22:06:29 +00:00
Andrew Scott 36b16e667a build: enable useUnknownInCatchVariables (#44679)
This unblocks the internal migration to turn the option on in g3.

PR Close #44679
2022-02-01 18:17:29 +00:00
Wiley Marques f0a8303abe docs(router): fixing pathMatch doc to style code correctly (#44796)
PR Close #44796
2022-01-24 10:42:52 -08:00
Andrew Scott 5a4ddfd4f5 feat(router): Allow symbol keys for Route data and resolve properties (#44519)
This commit adds the ability to use a symbol as the key for the `data` and `resolve` objects
in a `Route` config.

PR Close #44519
2022-01-10 19:43:12 +00:00
Kristiyan Kostadinov 359103274b test: clean up more entryComponents usages (#44561)
Cleans up some more tests that were using `entryComponents`.

PR Close #44561
2022-01-06 18:36:22 +00:00
Paul Gschwendtner 92806ff042 test: update router tests to work with es2015 temporal dead zone (#44505)
Update router tests to work with the the es2015 temporal dead zone.

Somewhat similar to: https://github.com/angular/angular/issues/30106.

PR Close #44505
2022-01-05 23:20:20 +00:00
Paul Gschwendtner c46d533b22 build: switch devmode output to es2015 (#44505)
To make our test output i.e. devmode output more aligned
with what we produce in the NPM packages, or to be more
aligned with what Angular applications will usually consume,
the devmode output is switched from ES5 to ES2015.

Additionally various tsconfigs (outside of Bazel) have been
updated to match with the other parts of the build. The rules
are:

ES2015 for test configurations, ES2020 for actual code that will
end up being shipped (this includes the IDE-only tsconfigs).

PR Close #44505
2022-01-05 23:20:20 +00:00
Chris Mancini 6a55affacd docs(router): fix code block for IsActiveMatchOptions (#44635)
PR Close #44635
2022-01-05 17:47:08 +00:00
Paul Gschwendtner 98c5063cd8 build: update visibility for npm package targets to work with new integration test structure (#44238)
As mentioned in the previous commit, integration tests will be declared
in subpackages of `//integration`. For these tests to still rely on the
NPM packages from `HEAD`, we need to update the visibility.

PR Close #44238
2021-12-08 13:42:41 -05:00
Paul Gschwendtner 444b2c497a test: remove unused router karma legacy setup (#44281)
Removes unused router karma legacy test setup that
just caused unnecessary confusion.

PR Close #44281
2021-11-30 11:56:05 -05:00
Paul Gschwendtner b23ce150d0 build: bundle spec files for saucelabs legacy job (#44281)
Bundle spec files similar to how it is done within the Angular
Components repo. This should simplify the setup and also speed
up the Saucelab job as only a single spec bundle would need to be
downloaded, compared to having to load hundreds of files through the
Saucelabs tunnel.

Also makes a couple of tests more robust with the emulators/and accounts
for ES2015 test runner changes. The tests should be less reluctant to
such build process changes.

Note for reviewers: Some imports have been simplified here. This work
came from Joey's original WIP for this. It's unclear to me whether this
is still needed, but it sounded like this was necessary for the ESBuild
bundling to work. I have robusted the module resolution plugin though,
so I doubt it's still needed. At the same time though: Not worth
reverting/trying as these changes are nice to have anyway!

Co-Authored-By: Joey Perrott <josephperrott@gmail.com>
Co-Authored-By: Paul Gschwendtner <paulgschwendtner@gmail.com>

PR Close #44281
2021-11-30 11:56:04 -05:00
unknown f44cb57c12 fix(router): prevent componentless routes from being detached (#44240)
Currently, when deactivating a route, the detach method of the RouteReuseStrategy is always called
even when we are dealing with a componentless route. If when using a custom strategy we attempt to
detach a componentless route, an exception is thrown causing the navigation to break.
This change prevents this from happening, by not triggering the detach of the route reuse strategy.

Fixes #44239

PR Close #44240
2021-11-23 17:12:27 +00:00
Martin von Gagern aac579d976 refactor(router): add type annotation for UrlSegment.parameterMap (#44175)
Having the type specified explicitly makes the API reference more readable.
PR Close #44175
2021-11-16 09:36:17 -08:00
Andrew Scott d015ac214f Revert "refactor(router): restore history in a consistent way on canceled navigations (#43651)" (#44006)
This reverts commit a268c4471f.

Causes failures in internal team's code. The failures likely relate to
attempting to manually update private Router state tracking properties,
which this change would have affected.

PR Close #44006
2021-11-01 09:25:36 -07:00
krzysztof-grzybek 45e4e60fd6 fix(router): reuse route strategy fix (#43791)
Currently, it's impossible to cache (detach/attach) parent route without caching child routes.
This produces a bug, when navigating from a/b to c, then to a/d, where a route is cached.
On the last navigation, we incorrectly restore a/b route instead of a/d.
This change introduces new behavior: if the route should be detached/attached,
we do so, but we check also child routes recursively.

Fixes #17333

PR Close #43791
2021-10-21 16:28:03 +00:00
Joey Perrott 9f40d2a0ea ci: remove browserstack configuration (#43881)
Remove browserstack configuration from the repo as it is not used for our CI.

PR Close #43881
2021-10-18 15:00:22 -07:00
Andrew Scott 32f368af2d fix(router): Do not clear currentNavigation if already set to next one (#43852)
Experimentation with the Router URL management exposed a situation where
the `currentNavigation` was being cleared in the `finalize` after the
`currentNavigation` was already set to the next one.

This change ensures that the `currentNavigation` is only cleared if the
id of the finalized transition matches the one on the
`currentNavigation` object.

PR Close #43852
2021-10-18 10:30:50 -07:00
Andrew Scott a3ee474897 refactor(router): Remove use of browserUrlTree in scheduleNavigation (#43632)
There are no added tests here because the change is generally equivalent
to what was there before. The goal of that piece of code is to prevent
duplicate navigations due to the location synchronization code between
AngularJS and Angular. That is, the Angular router listens to the
`popstate` event and triggers navigations, but so does the AngularJS
router and triggers navigations through `router.navigateByUrl`. The
`setTimeout` in the Angular Router's `setUpLocationChangeListener` is
there to make this bit of code work: the 'popstate'/'hashchange'
navigation will necessarily come after the imperative nav triggered by
AngularJS's location sync.

Anyhow, in the long run, I would like to get rid of this bit of code
altogether. We should not have special handling for these cases. The
AngularJS/Angular location sync should either:

1. Not trigger a duplicate navigation in the first place
or
2. Be tolerant to processing the duplicate navigation.

In the short term, this change benefits the router while we investigate
removing this logic completely because now browserUrlTree has a single
responsiblity: to support `onSameUrlNavigation==='reload'`. This means
that we can work towards removing the `browserUrlTree` tracking from the
Router code at some point as well and have the `onSameUrlNavigation`
logic be part of a pre-navigation hook that can be handled outside the
`Router`. This may or may not be possible, but the change here opens up
that change for investigation.

PR Close #43632
2021-10-18 10:29:22 -07:00
Andrew Scott e79e3cafec fix(router): fix Router's public API for canceledNavigationResolution (#43842)
The commit which made the `canceledNavigationResolution` property on the `Router`
public did not add the corresponding configuration in the `ExtraOptions`.
https://github.com/angular/angular/commit/3c6b653089837459809a370ebcaf8911c3bab9ed
This was a mistake and is being corrected in this commit. We should not
encourage changing the properties post-setup (i.e.
`inject(Router).canceledNavigationResolution = 'computed'`). This manner
of configuration makes the options non-tree shakeable because we have to
keep both implementations in case the value changes at runtime.

PR Close #43842
2021-10-15 11:35:01 -07:00
Andrew Scott 892158f769 Revert "refactor(router): clean up internal hooks (#43804)" (#43845)
This reverts commit 5cc51880db.

PR Close #43845
2021-10-14 14:43:41 -07:00
Andrew Scott 5cc51880db refactor(router): clean up internal hooks (#43804)
* beforePreactivation hook is unused
* The only place that uses afterPreactivation does not use the arguments

Not to say we won't want to provide hooks similar to this in the future,
but the current state is over-engineered for what it's being used for.

PR Close #43804
2021-10-14 10:04:01 -07:00
Alex Rickabaugh 48aa0039ea refactor(compiler-cli): update peerDependencies to require rxjs ^7.4.0 (#43748)
RxJS 7 versions prior to 7.4.0 export ES5 code, whereas Angular
applications using RxJS 6 today use ES2015. This was fixed in RxJS 7.4.0
which exposes ES2015 entrypoints as well. This commit updates Angular's
peer dependencies to require the newer RxJS.

PR Close #43748
2021-10-06 15:57:59 -07:00
Paul Gschwendtner e0a0d05d45 feat(core): update node version support range to support v16 (#43740)
This commit updates the `node` engines range for all Angular
framework packages to:

* No longer support NodeJS v12 `< 12.20`. This is done because APF v13
  uses package export patterns which are only supported as of v12.20.
  https://nodejs.org/api/packages.html#packages_subpath_patterns.

* Allows for the latest v16 NodeJS versions. This matches with the CLI
  which added NodeJS v16 support with https://github.com/angular/angular-cli/pull/21854.

  We already limit this to `>= v16.10.0` in preparation to only
  supporting the LTS minors of Node v16.

BREAKING CHANGE: NodeJS versions older than `v12.20.0` are no longer
supported due to the Angular packages using the NodeJS package exports
feature with subpath patterns.

PR Close #43740
2021-10-06 10:55:44 -07:00
Wey-Han Liaw 2ab2a080b6 fix(router): unset attachRef when router-outlet is destroyed to avoid mounting a destroyed component (#43697)
Previously, when a router-outlet is conditionally shown with an ngIf, and a sub-route was re-attached
via a custom RouteReuseStrategy, router-outlet would try to mount a destroyed component into the view
if the router-outlet is destroyed and re-initialized.

This commit fixes it by unsetting context.attachRef when router-outlet is destroyed, so when the
router-outlet is being initialized again, it no longer sees an attachRef that it needs to mount to the
view.

Fixes #43696

PR Close #43697
2021-10-05 09:48:39 -07:00
Kristiyan Kostadinov 94ba59bc9d feat(core): enable test module teardown by default (#43353)
Sets the `destroyAfterEach` teardown behavior to be enabled by default.

PR Close #43353
2021-10-04 16:57:16 -07:00
Andrew Scott a268c4471f refactor(router): restore history in a consistent way on canceled navigations (#43651)
The Router code currently has special-case handling around when and how
the internal state is reset. Specifically, it only resets the internal
tracking of the state when an error is thrown, which does not happen
when guards reject or resolvers return `EMPTY`. Other than the
navigation URL not matching a config, guards rejecting would be the main
cause of a navigation being turned down.

This change updates the router code to always reset the internal state
in the same way, regardless of the reason for navigation cancellation.

In the end, this will only affect _very_ specific use-cases with
`UrlHandlingStrategy`. Because the internal state is not updated until
the end of the transition pipe, the state reset generally doesn't do
anything at all. However, because the `rawUrlTree` is reset by calling
`urlHandlingStrategy.merge` with the _attempted_ `rawUrl` that failed,
the resulting browser URL reset could be different than before (but will
now be consistent with how the URL is reset in other scenarios, like a
URL not matching a `Route` config).

PR Close #43651
2021-10-04 10:55:49 -07:00
Andrew Scott f513b1773e refactor(router): add stub files for g3 patch of NgModuleFactoryLoader (#43660)
Internally, g3 code still uses the `loadChildren: string` syntax. We
need to continue to provide this functionality with an internal patch.
This change makes that patch easier by only touching stub files that
support the `loadChildren: string` (other than `router_config_loader`).

PR Close #43660
2021-10-04 10:28:02 -07:00
Paul Gschwendtner e6046c9420 refactor: remove entry_point attribute from ng_package targets (#43431)
With the changes to support APF v13 in the `ng_package` rule, we have
removed the ambiguous `entry_point` attribute. The attribute suggested
that it would be used for determining the primary entry-point input
file. This was not the case as the flat module output file is consulted
for bundling et at. The attribute has been renamed to match its
purposed (renamed to `primary_bundle_name`).

We no longer need to set that attribute because the primary bundle
name is (1) not of relevance for consumers and (2) the rule already
infers the bundle name properly from the Bazel package.

PR Close #43431
2021-10-01 18:28:42 +00:00
JoostK 361273fad5 refactor(router): remove support for loadChildren string syntax (#43591)
This commit removes the ability to configure lazy routes using a string
for `loadChildren`, together with the supporting classes to load an
`NgModuleFactory` at runtime.

BREAKING CHANGE:

It is no longer possible to use `Route.loadChildren` using a string
value. The following supporting classes were removed from
`@angular/core`:

- `NgModuleFactoryLoader`
- `SystemJsNgModuleFactoryLoader`

The `@angular/router` package no longer exports these symbols:

- `SpyNgModuleFactoryLoader`
- `DeprecatedLoadChildren`

The signature of the `setupTestingRouter` function from
`@angular/core/testing` has been changed to drop its `NgModuleFactoryLoader`
parameter, as an argument for that parameter can no longer be created.

PR Close #43591
2021-09-29 14:45:18 -07:00
JoostK 05c08cac9a docs: refactor example apps to use dynamic imports for loadChildren (#43591)
The string syntax for `loadChildren` has been deprecated and is being
removed, so this commit refactors the examples to the new syntax.

PR Close #43591
2021-09-29 14:45:17 -07:00
Andrew Scott 09d325a9e6 test(router): refactor tests to not use deprecated loadChildren (#43578)
Many of the tests in the router code use the deprecated loadChildren as a string. This
has been deprecated for years and can easily be changed to just a function that
returns the module.

PR Close #43578
2021-09-29 11:14:07 -07:00
Dmitrij Kuba 4f3beffdbf feat(router): emit activate/deactivate events when an outlet gets attached/detached (#43333)
Previously the events of `RouterOutlet` (activate/deactivate) were not fired
when an outlet got attached/detached with `RouteReuseStrategy`. The changes configure
`RouterOutlet` to emit events when an outlet gets attached/detached.

Fixes #25521, #20501

PR Close #43333
2021-09-28 14:16:39 -07:00
Kristiyan Kostadinov ea61ec2562 feat(core): support TypeScript 4.4 (#43281)
Adds support for TypeScript 4.4. High-level overview of the changes made in this PR:

* Bumps the various packages to `typescript@4.4.2` and `tslib@2.3.0`.
* The `useUnknownInCatchVariables` compiler option has been disabled so that we don't have to cast error objects explicitly everywhere.
* TS now passes in a third argument to the `__spreadArray` call inside child class constructors. I had to update a couple of places in the runtime and ngcc to be able to pick up the calls correctly.
* TS now generates code like `(0, foo)(arg1, arg2)` for imported function calls. I had to update a few of our tests to account for it. See https://github.com/microsoft/TypeScript/pull/44624.
* Our `ngtsc` test setup calls the private `matchFiles` function from TS. I had to update our usage, because a new parameter was added.
* There was one place where we were setting the readonly `hasTrailingComma` property. I updated the usage to pass in the value when constructing the object instead.
* Some browser types were updated which meant that I had to resolve some trivial type errors.
* The downlevel decorators tranform was running into an issue where the Closure synthetic comments were being emitted twice. I've worked around it by recreating the class declaration node instead of cloning it.

PR Close #43281
2021-09-23 14:49:19 -07:00
Daniel Díaz cc427d18c4 docs(router): fix typo in router event API documentation (#43555)
PR Close #43555
2021-09-23 14:45:27 -07:00
Andrew Scott c5d0bd4966 fix(router): Prevent URL flicker when new navigations cancel ongoing ones (#43496)
This bit of code is problematic for several reasons:
1. AngularJS-specific handling should not exist in core router code if it can be avoided.
It's not something that should complicated the code long-term
2. It causes URL flickering (the `replace: /` really does happen and can be observed)
3. The original intent was likely for the URL to not actually change;
since the Router only initially supported 'deferred' navigations, this would _usually_ be the case.
4. It actually causes observers of URL changes more problems in handling changes
because the router is already about to process another navigation request.
Notice that when using `'computed'` restoration logic, we do not reset the URL
because it would cause another location change event and conflict with the new navigation.
5. It only resets the browser URL but does nothing to sync the rest of the internal state of the router.
6. It makes guards which call `router.navigate()` behave _slightly_ differently
than guard which return `UrlTree`. Guards which return `UrlTree` do not reset the
URL, but instead just trigger a new navigation.
7. It resets the entire URL rather than just the portion that the
   `UrlHandlingStrategy` is configured to handle. Theoretically, the
   Router could be configured to only handle a part of the URL so failed
   navigations should not reset parts it is not configured to touch.
   Note that this is actually a problem in other places in the router as
   well where `resetState` is not called before
   `resetUrlToCurrentUrlTree`.

As a nice benefit, when `urlUpdateStrategy` is set to `'eager'`, this
makes #17004 possible.

BREAKING CHANGE:
The router will no longer replace the browser URL when a new navigation
cancels an ongoing navigation. This often causes URL flicker and was
only in place to support some AngularJS hybrid applications. Hybrid
applications which rely on the `navigationId` being present on initial
navigations that were handled by the Angular router should instead
subscribe to `NavigationCancel` events and perform the
`location.replaceState` themselves to add `navigationId` to the Router
state.
In addition, tests which assert `urlChanges` on the `SpyLocation` may
need to be adjusted to account for the `replaceState` which is no longer
triggered.

PR Close #43496
2021-09-20 20:57:57 +00:00
Andrew Scott 79700822fd refactor(router): remove unnecessary getTransition function (#43436)
The getTransition helper function ensures that urlAfterRedirects is assigned for when
the router does not process the previous or current URL. In this case, we would set
the browserUrlTree to be the urlAfterRedirects, which was initialized to be the browserUrlTree.
This is a no-op, so there's no need for the getTransition function at all.

PR Close #43436
2021-09-16 19:20:57 +00:00
Andrew Scott 3ec9ee65b9 refactor(router): Remove TODO and slightly adjust eager browserUrlTree update (#43426)
No test was added for this case because I can't think of a test case to
write that would work.

This change updates the code for a consistent mental model of setting
the `browserUrlTree`. It's only meant to track the `UrlTree` that the
`UrlHandlingStrategy` is set to extract, not the full `rawUrl`. Notice
that everywhere else, the `browserUrlTree` is set to
`urlAfterRedirects`, which is computed based on the extracted URL, _not_
the `rawUrl`.

PR Close #43426
2021-09-14 11:11:43 -07:00
Andrew Scott 5163999fb9 test(router): Add tests to document expected behavior (#43449)
PR #43102 broke some use-cases. These tests document expected behavior
and would have prevented #43446 and #43447. Recent changes have already
addressed these issues, but it would still be a good idea to cover these
use-cases in tests as well.

PR Close #43449
2021-09-14 11:11:08 -07:00
Andrew Scott 796da641f0 fix(router): Do not modify parts of URL excluded from with 'eager' updates (#43421)
The previous code would set the browser URL to be only the part that's
extracted by the `UrlHandlingStrategy`. However, there may be parts of
the URL which are _should not_ be handled by the Angular Router. This
change updates the code to set the browser URL in the same way that's
done with `'deferred'`: Merging the extracted URL after redirects with
the whole raw URL of the navigation, which includes parts not handled by
the `UrlHandlingStrategy`.

PR Close #43421
2021-09-14 08:35:15 -07:00