• Overview
@angular/common/upgrade

UrlCodec

Class

A codec for encoding and decoding URL parts.

  
    abstract class UrlCodec {
}

encodePath

string

Encodes the path from the provided string

@parampathstring

The path string

@returnsstring

decodePath

string

Decodes the path from the provided string

@parampathstring

The path string

@returnsstring

encodeSearch

string

Encodes the search string from the provided string or object

@paramsearchstring | { [k: string]: unknown; }
@returnsstring

decodeSearch

{ [k: string]: unknown; }

Decodes the search objects from the provided string

@paramsearchstring
@returns{ [k: string]: unknown; }

encodeHash

string

Encodes the hash from the provided string

@paramhashstring
@returnsstring

decodeHash

string

Decodes the hash from the provided string

@paramhashstring
@returnsstring

normalize

2 overloads

Normalizes the URL from the provided string

@paramhrefstring
@returnsstring

Normalizes the URL from the provided string, search, hash, and base URL parameters

@parampathstring

The URL path

@paramsearch{ [k: string]: unknown; }

The search object

@paramhashstring

The has string

@parambaseUrlstring | undefined

The base URL for the URL

@returnsstring

areEqual

boolean

Checks whether the two strings are equal

@paramvalAstring

First string for comparison

@paramvalBstring

Second string for comparison

@returnsboolean

parse

{ href: string; protocol: string; host: string; search: string; hash: string; hostname: string; port: string; pathname: string; }

Parses the URL string based on the base URL

@paramurlstring

The full URL string

@parambasestring | undefined

The base for the URL

@returns{ href: string; protocol: string; host: string; search: string; hash: string; hostname: string; port: string; pathname: string; }
Jump to details