From cfe00338543efbae14ebcb54531b09451a731ebf Mon Sep 17 00:00:00 2001 From: arturovt Date: Sat, 24 Aug 2019 00:41:02 +0300 Subject: [PATCH] fix(router-plugin): "includeHash" must be truthy requesting path --- packages/router-plugin/src/router.state.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/packages/router-plugin/src/router.state.ts b/packages/router-plugin/src/router.state.ts index a9cc30f84..d7a6af9c8 100644 --- a/packages/router-plugin/src/router.state.ts +++ b/packages/router-plugin/src/router.state.ts @@ -217,10 +217,10 @@ export class RouterState { // `Location.prototype.normalize` strips base href from the URL, // if `baseHref` (declared in angular.json) for example is `/en` - // and the URL is `/test` - then `_locationStrategy.path()` will return `/en/test`, - // but `/en/test` is not known to the Angular's router, so we have to strip `/en` + // and the URL is `/test#anchor` - then `_locationStrategy.path(true)` will return `/en/test#anchor`, + // but `/en/test#anchor` is not known to the Angular's router, so we have to strip `/en` // from the URL - const currentUrl = this._location.normalize(this._locationStrategy.path()); + const currentUrl = this._location.normalize(this._locationStrategy.path(true)); const currentUrlTree = this._urlSerializer.parse(currentUrl); // We need to serialize the URL because in that example `/test/?redirect=https://google.com/` // Angular will recognize it as `/test?redirect=https:%2F%2Fwww.google.com%2F`