$locationShim
Location service that provides a drop-in replacement for the $location service provided in AngularJS.
class $locationShim {
constructor($injector: any, location: Location, platformLocation: PlatformLocation, urlCodec: UrlCodec, locationStrategy: LocationStrategy)
onChange(fn: (url: string, state: unknown, oldUrl: string, oldState: unknown) => void, err: (e: Error) => void = (e: Error) => { })
$$parse(url: string)
$$parseLinkUrl(url: string, relHref?: string): boolean
absUrl(): string
url(url?: string): string | this
protocol(): string
host(): string
port(): number | null
path(path?: string | number): string | this
search(search?: string | number | { [key: string]: unknown; }, paramValue?: string | number | boolean | string[]): {...}
hash(hash?: string | number): string | this
replace(): this
state(state?: unknown): unknown | this
}
参见
构造函数
参数
|
方法
Registers listeners for URL changes. This API is used to catch updates performed by the AngularJS framework. These changes are a subset of the | ||||||
参数
| ||||||
It's possible for |
Parses the provided URL, and sets the current URL to the parsed result. |
Parses the provided URL and its relative URL. |
Retrieves the full URL representation with all segments encoded according to rules specified in RFC 3986. |
参数没有参数。 返回值
|
|
Retrieves the current URL, or sets a new URL. When setting a URL, changes the path, search, and hash, and returns a reference to its own instance.
参数没有参数。 返回值
|
|
Retrieves the protocol of the current URL. |
参数没有参数。 返回值
|
|
Retrieves the protocol of the current URL. |
In contrast to the non-AngularJS version
|
Retrieves the port of the current URL. |
参数没有参数。 返回值
|
|
Retrieves the path of the current URL, or changes the path and returns a reference to its own instance.
参数没有参数。 返回值
|
Paths should always begin with forward slash (/). This method adds the forward slash if it is missing.
|
3 个重载形式...显示所有 隐藏所有 expand_moreOverload #1Retrieves a map of the search parameters of the current URL, or changes a search part and returns a reference to its own instance.
参数没有参数。 返回值`{ } Overload #2
参数
返回值
Overload #3 | |||
|
Retrieves the current hash fragment, or changes the hash fragment and returns a reference to its own instance.
参数没有参数。 返回值
|
|
Changes to |
参数没有参数。 返回值
|
Retrieves the history state object when called without any parameter.
参数没有参数。 返回值
|
Change the history state object when called with one parameter and return This method is supported only in HTML5 mode and only in browsers supporting the HTML5 History API methods such as |