mirror of
https://github.com/angular/angular.git
synced 2026-11-30 18:37:49 -05:00
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
Angular
The sources for this package are in the main Angular repo. Please file issues and pull requests against that repo.
Usage information and reference details can be found in Angular documentation.
License: MIT