填寫這份《一分鐘調查》,幫我們(開發組)做得更好!去填寫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`.