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

AngularJSUrlCodec

一个 UrlCodec,它使用 AngularJS 中的逻辑来序列化和解析 URL 和 URL 参数。

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)
}
    

方法

      
      encodePath(path: string): string
    
参数
path string
返回值

string

      
      encodeSearch(search: string | { [k: string]: unknown; }): string
    
参数
search string | { [k: string]: unknown; }
返回值

string

      
      encodeHash(hash: string)
    
参数
hash string
      
      decodePath(path: string, html5Mode: boolean = true): string
    
参数
path string
html5Mode boolean
可选. 默认值是 `true`.
返回值

string

      
      decodeSearch(search: string)
    
参数
search string
      
      decodeHash(hash: string)
    
参数
hash string
      
      normalize(href: string): string
    
参数
href string
返回值

string

      
      normalize(path: string, search: { [k: string]: unknown; }, hash: string, baseUrl?: string): string
    
参数
path string
search object
hash string
baseUrl string
可选. 默认值是 `undefined`.
返回值

string

      
      areEqual(valA: string, valB: string)
    
参数
valA string
valB string
      
      parse(url: string, base?: string)
    
参数
url string
base string
可选. 默认值是 `undefined`.