[ Web Proxy ]
URL:
Viewing: https://angular.dev/api/common/testing/MockPlatformLocation [Back]  [Original]

MockPlatformLocation Angular Skip to main content
menu
close
more_horiz
menuAPI
@angular/common/testing

MockPlatformLocation

Class
stable

Mock implementation of URL state.

On this page

    arrow_upward_alt Back to the top

    API

        
          class MockPlatformLocation implements PlatformLocation {  constructor(config?: MockPlatformLocationConfig | undefined);  readonly hostname: string;  readonly protocol: string;  readonly port: string;  readonly pathname: string;  readonly search: string;  readonly hash: string;  readonly state: unknown;  getBaseHrefFromDOM(): string;  onPopState(fn: LocationChangeListener): VoidFunction;  onHashChange(fn: LocationChangeListener): VoidFunction;  readonly href: string;  readonly url: string;  replaceState(state: any, title: string, newUrl: string): void;  pushState(state: any, title: string, newUrl: string): void;  forward(): void;  back(): void;  historyGo(relativePosition?: number): void;  getState(): unknown;}
        
        

    hostname

    string

    protocol

    string

    port

    string

    pathname

    string

    hash

    string

    state

    unknown

    getBaseHrefFromDOM

    string
    @returnsstring

    onPopState

    VoidFunction
    @paramfnLocationChangeListener
    @returnsVoidFunction

    onHashChange

    VoidFunction
    @paramfnLocationChangeListener
    @returnsVoidFunction

    href

    string

    url

    string

    replaceState

    void
    @paramstateany
    @paramtitlestring
    @paramnewUrlstring
    @returnsvoid

    pushState

    void
    @paramstateany
    @paramtitlestring
    @paramnewUrlstring
    @returnsvoid

    forward

    void
    @returnsvoid

    back

    void
    @returnsvoid

    historyGo

    void
    @paramrelativePositionnumber
    @returnsvoid

    getState

    unknown
    @returnsunknown
    Jump to details

    Web Proxy Viewer  |  New URL  |  Original Page