MCPcopy
hub / github.com/angular/angular / setHash

Method setHash

packages/platform-server/src/location.ts:79–94  ·  view source on GitHub ↗
(value: string, oldUrl: string)

Source from the content-addressed store, hash-verified

77 }
78
79 private setHash(value: string, oldUrl: string) {
80 if (this.hash === value) {
81 // Don't fire events if the hash has not changed.
82 return;
83 }
84 (this as Writable<this>).hash = value;
85 const newUrl = this.url;
86 queueMicrotask(() =>
87 this._hashUpdate.next({
88 type: 'hashchange',
89 state: null,
90 oldUrl,
91 newUrl,
92 } as LocationChangeEvent),
93 );
94 }
95
96 replaceState(state: any, title: string, newUrl: string): void {
97 const oldUrl = this.url;

Callers 1

replaceStateMethod · 0.95

Calls 1

nextMethod · 0.45

Tested by

no test coverage detected