(locationStrategy: LocationStrategy)
| 67 | _urlChangeSubscription: SubscriptionLike | null = null; |
| 68 | |
| 69 | constructor(locationStrategy: LocationStrategy) { |
| 70 | this._locationStrategy = locationStrategy; |
| 71 | const baseHref = this._locationStrategy.getBaseHref(); |
| 72 | // Note: This class's interaction with base HREF does not fully follow the rules |
| 73 | // outlined in the spec https://www.freesoft.org/CIE/RFC/1808/18.htm. |
| 74 | // Instead of trying to fix individual bugs with more and more code, we should |
| 75 | // investigate using the URL constructor and providing the base as a second |
| 76 | // argument. |
| 77 | // https://developer.mozilla.org/en-US/docs/Web/API/URL/URL#parameters |
| 78 | this._basePath = _stripOrigin(stripTrailingSlash(_stripIndexHtml(baseHref))); |
| 79 | this._locationStrategy.onPopState((ev) => { |
| 80 | const popStateEvent: PopStateEvent = { |
| 81 | 'url': this.path(true), |
| 82 | 'pop': true, |
| 83 | 'state': ev.state, |
| 84 | 'type': ev.type, |
| 85 | }; |
| 86 | if (ev.hasUAVisualTransition) { |
| 87 | popStateEvent.hasUAVisualTransition = true; |
| 88 | } |
| 89 | this._subject.next(popStateEvent); |
| 90 | }); |
| 91 | } |
| 92 | |
| 93 | /** @docs-private */ |
| 94 | ngOnDestroy(): void { |
nothing calls this directly
no test coverage detected