Cookies concent notice

This site uses cookies from Google to deliver its services and to analyze traffic.
Learn more
Skip to main content
This site is no longer updated.Head to Angular.devHome
/

This is the archived documentation for Angular v17. Please visit angular.dev to see this page for the current version of Angular.

UrlSerializer

Serializes and deserializes a URL string into a URL tree.

See more...

      
      abstract class UrlSerializer {
abstract parse(url: string): UrlTree
abstract serialize(tree: UrlTree): string }

Provided in

  • 'root'

Description

The url serialization strategy is customizable. You can make all URLs case insensitive by providing a custom UrlSerializer.

See DefaultUrlSerializer for an example of a URL serializer.

Methods

Parse a url into a UrlTree

      
      abstract parse(url: string): UrlTree
    
Parameters
url string
Returns

UrlTree

Converts a UrlTree into a url

      
      abstract serialize(tree: UrlTree): string
    
Parameters
tree UrlTree
Returns

string