MockLocationStrategy
的模拟实现,允许测试触发模拟的 location 事件。
A mock implementation of LocationStrategy
that allows tests to fire simulated location events.
LocationStrategy
class MockLocationStrategy extends LocationStrategy {
internalBaseHref: string
internalPath: string
internalTitle: string
urlChanges: string[]
simulatePopState(url: string): void
path(includeHash: boolean = false): string
prepareExternalUrl(internal: string): string
pushState(ctx: any, title: string, path: string, query: string): void
replaceState(ctx: any, title: string, path: string, query: string): void
onPopState(fn: (value: any) => void): void
getBaseHref(): string
back(): void
forward(): void
getState(): unknown
// 继承自 common/LocationStrategy
abstract path(includeHash?: boolean): string
abstract prepareExternalUrl(internal: string): string
abstract pushState(state: any, title: string, url: string, queryParams: string): void
abstract replaceState(state: any, title: string, url: string, queryParams: string): void
abstract forward(): void
abstract back(): void
historyGo(relativePosition: number)?: void
abstract onPopState(fn: LocationChangeListener): void
abstract getBaseHref(): string
}
属性
属性 | 说明 |
---|---|
internalBaseHref: string | |
internalPath: string | |
internalTitle: string | |
urlChanges: string[] |
方法
参数没有参数。 返回值
|
参数没有参数。 返回值
|
参数没有参数。 返回值
|
参数没有参数。 返回值
|