MCPcopy Index your code
hub / github.com/angular/angular / historyGo

Method historyGo

packages/common/testing/src/location_mock.ts:150–161  ·  view source on GitHub ↗
(relativePosition: number = 0)

Source from the content-addressed store, hash-verified

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);

Callers 1

location_spec.tsFile · 0.45

Calls 3

pathMethod · 0.95
getStateMethod · 0.95
nextMethod · 0.45

Tested by

no test coverage detected