mirror of
https://github.com/angular/angular.git
synced 2026-09-14 13:54:52 +08:00
fe721868a6
Previously, `NavigationStateManager` relied on string-based comparisons and `.substring()` to match `NavigateEvent` URLs against internal router transitions or the application root boundary. This was brittle against trailing slashes, query parameter order variations, and sibling application URLs. This commit updates the logic to: - Use the native `URL` object to strictly compare `origin` and `pathname` for `appRootURL` boundaries. - Sort `searchParams` and use `Location.stripTrailingSlash()` to robustly compare the router destination against the event destination. - Pre-compute and store `appRootUrl` as a `URL` object to avoid redundant parsing on every navigation.
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