Skip to content

Commit

Permalink
fix(router-plugin): "includeHash" must be truthy requesting path (#1265)
Browse files Browse the repository at this point in the history
  • Loading branch information
arturovt authored and markwhitfeld committed Aug 26, 2019
1 parent 03e28e7 commit 9b040f0
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/router-plugin/src/router.state.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit 9b040f0

Please sign in to comment.