SpyLocation

SpyLocation

Experimental Class

Class Overview

class SpyLocation implements Location {
  urlChanges : string[]
  setInitialPath(url: string)
  setBaseHref(url: string)
  path() : string
  isCurrentPathEqualTo(path: string, query?: string) : boolean
  simulateUrlPop(pathname: string)
  simulateHashChange(pathname: string)
  prepareExternalUrl(url: string) : string
  go(path: string, query?: string)
  replaceState(path: string, query?: string)
  forward()
  back()
  subscribe(onNext: (value: any) => void, onThrow?: (error: any) => void, onReturn?: () => void) : Object
  normalize(url: string) : string
}

Class Description

A spy for Location that allows tests to fire simulated location events.

Annotations

@Injectable()

Class Details

urlChanges : string[]
setInitialPath(url: string)
setBaseHref(url: string)
path() : string
isCurrentPathEqualTo(path: string, query?: string) : boolean
simulateUrlPop(pathname: string)
simulateHashChange(pathname: string)
prepareExternalUrl(url: string) : string
go(path: string, query?: string)
replaceState(path: string, query?: string)
forward()
back()
subscribe(onNext: (value: any) => void, onThrow?: (error: any) => void, onReturn?: () => void) : Object
normalize(url: string) : string

exported from @angular-common-testing-index, defined in @angular/common/testing/location_mock.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v2.angular.io/docs/ts/latest/api/common/testing/index/SpyLocation-class.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部