填写这份《一分钟调查》,帮我们(开发组)做得更好!去填写Home

MockPlatformLocation

Mock implementation of URL state.

      
      class MockPlatformLocation implements PlatformLocation {
  hostname
  protocol
  port
  pathname
  search
  hash
  state
  href: string
  url: string
  getBaseHrefFromDOM(): string
  onPopState(fn: LocationChangeListener): void
  onHashChange(fn: LocationChangeListener): void
  replaceState(state: any, title: string, newUrl: string): void
  pushState(state: any, title: string, newUrl: string): void
  forward(): void
  back(): void
  getState(): unknown
}
    

属性

属性说明
hostname只读
protocol只读
port只读
pathname只读
search只读
hash只读
state只读
href: string只读
url: string只读

方法

getBaseHrefFromDOM(): string
      
      getBaseHrefFromDOM(): string
    
参数

没有参数。

返回值

string

onPopState(fn: LocationChangeListener): void
      
      onPopState(fn: LocationChangeListener): void
    
参数
fn LocationChangeListener
返回值

void

onHashChange(fn: LocationChangeListener): void
      
      onHashChange(fn: LocationChangeListener): void
    
参数
fn LocationChangeListener
返回值

void

replaceState(state: any, title: string, newUrl: string): void
      
      replaceState(state: any, title: string, newUrl: string): void
    
参数
state any
title string
newUrl string
返回值

void

pushState(state: any, title: string, newUrl: string): void
      
      pushState(state: any, title: string, newUrl: string): void
    
参数
state any
title string
newUrl string
返回值

void

forward(): void
      
      forward(): void
    
参数

没有参数。

返回值

void

back(): void
      
      back(): void
    
参数

没有参数。

返回值

void

getState(): unknown
      
      getState(): unknown
    
参数

没有参数。

返回值

unknown