feat(router): add navigationSource and restoredState to NavigationStart event (#21728)
Currently, NavigationStart there is no way to know if an navigation was triggered imperatively or via the location change. These two use cases should be handled differently for a variety of use cases (e.g., scroll position restoration). This PR adds a navigation source field and restored navigation id (passed to navigations triggered by a URL change). PR Close #21728
This commit is contained in:
@ -63,8 +63,9 @@ export class ServerPlatformLocation implements PlatformLocation {
|
||||
}
|
||||
(this as{hash: string}).hash = value;
|
||||
const newUrl = this.url;
|
||||
scheduleMicroTask(
|
||||
() => this._hashUpdate.next({ type: 'hashchange', oldUrl, newUrl } as LocationChangeEvent));
|
||||
scheduleMicroTask(() => this._hashUpdate.next({
|
||||
type: 'hashchange', state: null, oldUrl, newUrl
|
||||
} as LocationChangeEvent));
|
||||
}
|
||||
|
||||
replaceState(state: any, title: string, newUrl: string): void {
|
||||
|
Reference in New Issue
Block a user