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

Method replaceState

packages/common/testing/src/location_mock.ts:107–124  ·  view source on GitHub ↗
(path: string, query: string = '', state: any = null)

Source from the content-addressed store, hash-verified

105 }
106
107 replaceState(path: string, query: string = '', state: any = null) {
108 path = this.prepareExternalUrl(path);
109
110 const history = this._history[this._historyIndex];
111
112 history.state = state;
113
114 if (history.path == path && history.query == query) {
115 return;
116 }
117
118 history.path = path;
119 history.query = query;
120
121 const url = path + (query.length > 0 ? '?' + query : '');
122 this.urlChanges.push('replace: ' + url);
123 this._notifyUrlChangeListeners(path + normalizeQueryParams(query), state);
124 }
125
126 forward() {
127 if (this._historyIndex < this._history.length - 1) {

Callers

nothing calls this directly

Calls 4

prepareExternalUrlMethod · 0.95
normalizeQueryParamsFunction · 0.50
pushMethod · 0.45

Tested by

no test coverage detected