(relativePosition: number = 0)
| 148 | } |
| 149 | |
| 150 | historyGo(relativePosition: number = 0): void { |
| 151 | const nextPageIndex = this._historyIndex + relativePosition; |
| 152 | if (nextPageIndex >= 0 && nextPageIndex < this._history.length) { |
| 153 | this._historyIndex = nextPageIndex; |
| 154 | this._subject.next({ |
| 155 | 'url': this.path(), |
| 156 | 'state': this.getState(), |
| 157 | 'pop': true, |
| 158 | 'type': 'popstate', |
| 159 | }); |
| 160 | } |
| 161 | } |
| 162 | |
| 163 | onUrlChange(fn: (url: string, state: unknown) => void): VoidFunction { |
| 164 | this._urlChangeListeners.push(fn); |
no test coverage detected