Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 4 additions & 17 deletions packages/common/src/location/platform_location.ts
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ export abstract class PlatformLocation {
}
}

export function useBrowserPlatformLocation() {
function useBrowserPlatformLocation() {
return ɵɵinject(BrowserPlatformLocation);
}

Expand Down Expand Up @@ -101,8 +101,6 @@ export interface LocationChangeListener {
(event: LocationChangeEvent): any;
}



/**
* `PlatformLocation` encapsulates all of the direct calls to platform APIs.
* This class should not be used directly by an application developer. Instead, use
Expand Down Expand Up @@ -167,19 +165,11 @@ export class BrowserPlatformLocation extends PlatformLocation {
}

override pushState(state: any, title: string, url: string): void {
if (supportsState()) {
this._history.pushState(state, title, url);
} else {
this._location.hash = url;
}
this._history.pushState(state, title, url);
}

override replaceState(state: any, title: string, url: string): void {
if (supportsState()) {
this._history.replaceState(state, title, url);
} else {
this._location.hash = url;
}
this._history.replaceState(state, title, url);
}

override forward(): void {
Expand All @@ -199,9 +189,6 @@ export class BrowserPlatformLocation extends PlatformLocation {
}
}

export function supportsState(): boolean {
return !!window.history.pushState;
}
export function createBrowserPlatformLocation() {
function createBrowserPlatformLocation() {
return new BrowserPlatformLocation(ɵɵinject(DOCUMENT));
}