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:
4
tools/public_api_guard/common/testing.d.ts
vendored
4
tools/public_api_guard/common/testing.d.ts
vendored
@ -21,12 +21,12 @@ export declare class SpyLocation implements Location {
|
||||
urlChanges: string[];
|
||||
back(): void;
|
||||
forward(): void;
|
||||
go(path: string, query?: string): void;
|
||||
go(path: string, query?: string, state?: any): void;
|
||||
isCurrentPathEqualTo(path: string, query?: string): boolean;
|
||||
normalize(url: string): string;
|
||||
path(): string;
|
||||
prepareExternalUrl(url: string): string;
|
||||
replaceState(path: string, query?: string): void;
|
||||
replaceState(path: string, query?: string, state?: any): void;
|
||||
setBaseHref(url: string): void;
|
||||
setInitialPath(url: string): void;
|
||||
simulateHashChange(pathname: string): void;
|
||||
|
Reference in New Issue
Block a user