AngularJSUrlCodec

class

A UrlCodec that uses logic from AngularJS to serialize and parse URLs and URL parameters.

class AngularJSUrlCodec implements UrlCodec {
  encodePath(path: string): string
  encodeSearch(search: string | { [k: string]: unknown; }): string
  encodeHash(hash: string)
  decodePath(path: string, html5Mode: boolean = true): string
  decodeSearch(search: string)
  decodeHash(hash: string)
  normalize(pathOrHref: string, search?: { [k: string]: unknown; }, hash?: string, baseUrl?: string): string
  areEqual(valA: string, valB: string)
  parse(url: string, base?: string)
}

Methods

encodePath(path: string): string

Parameters
path string
Returns

string

encodeSearch(search: string | { [k: string]: unknown; }): string

Parameters
search string | { [k: string]: unknown; }
Returns

string

encodeHash(hash: string)

Parameters
hash string

decodePath(path: string, html5Mode: boolean = true): string

Parameters
path string
html5Mode boolean

Optional. Default is true.

Returns

string

decodeSearch(search: string)

Parameters
search string

decodeHash(hash: string)

Parameters
hash string

normalize(href: string): string

Parameters
href string
Returns

string

normalize(path: string, search: { [k: string]: unknown; }, hash: string, baseUrl?: string): string

Parameters
path string
search object
hash string
baseUrl string

Optional. Default is undefined.

Returns

string

areEqual(valA: string, valB: string)

Parameters
valA string
valB string

parse(url: string, base?: string)

Parameters
url string
base string

Optional. Default is undefined.

© 2010–2020 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v10.angular.io/api/common/upgrade/AngularJSUrlCodec