feat(common): add APIs to read component pieces of URL (#30055)
Without this change, the framework doesn't surface URL parts such as hostname, protocol, and port. This makes it difficult to rebuild a complete URL. This change provides new APIs to read these values. PR Close #30055
This commit is contained in:
@ -49,6 +49,9 @@ export class BrowserPlatformLocation extends PlatformLocation {
|
||||
getDOM().getGlobalEventTarget(this._doc, 'window').addEventListener('hashchange', fn, false);
|
||||
}
|
||||
|
||||
get protocol(): string { return this.location.protocol; }
|
||||
get hostname(): string { return this.location.hostname; }
|
||||
get port(): string { return this.location.port; }
|
||||
get pathname(): string { return this.location.pathname; }
|
||||
get search(): string { return this.location.search; }
|
||||
get hash(): string { return this.location.hash; }
|
||||
|
Reference in New Issue
Block a user