MCPcopy Create free account
hub / github.com/angular/angular / replaceState

Method replaceState

packages/common/src/location/location.ts:187–193  ·  view source on GitHub ↗

* Changes the browser's URL to a normalized version of the given URL, and replaces * the top item on the platform's history stack. * * @param path URL path to normalize. * @param query Query parameters. * @param state Location history state.

(path: string, query: string = '', state: any = null)

Source from the content-addressed store, hash-verified

185 * @param state Location history state.
186 */
187 replaceState(path: string, query: string = '', state: any = null): void {
188 this._locationStrategy.replaceState(state, '', path, query);
189 this._notifyUrlChangeListeners(
190 this.prepareExternalUrl(path + normalizeQueryParams(query)),
191 state,
192 );
193 }
194
195 /**
196 * Navigates forward in the platform's history.

Callers 5

browserUrlMethod · 0.45
setBrowserUrlMethod · 0.45

Implementers 1

SpyLocationpackages/common/testing/src/location_m

Calls 3

prepareExternalUrlMethod · 0.95
normalizeQueryParamsFunction · 0.90

Tested by 1