feat(common): add ability to watch for AngularJS URL updates through onUrlChange hook (#30466)

The LocationShim (replacement for `$location`) was added to centralize dealing with the browser URL. Additionally, an `onUrlChange` method was added to Angular's Location service. This PR adds a corresponding method to the LocationShim so updates from AngularJS can be tracked in Angular.

PR Close #30466
This commit is contained in:
Jason Aden
2019-05-14 15:00:21 -07:00
parent 077809398c
commit 1aff524b63
3 changed files with 116 additions and 0 deletions

View File

@ -6,6 +6,7 @@ export declare class $locationShim {
hash(hash: string | number | null): this;
hash(): string;
host(): string;
onChange(fn: (url: string, state: unknown, oldUrl: string, oldState: unknown) => void, err?: (e: Error) => void): void;
path(): string;
path(path: string | number | null): this;
port(): number | null;