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.

DefaultUrlSerializer

A default implementation of the UrlSerializer.

See more...

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

Description

Example URLs:

      
      /inbox/33(popup:compose)
/inbox/33;open=true/messages/44
    

DefaultUrlSerializer uses parentheses to serialize secondary segments (e.g., popup:compose), the colon syntax to specify the outlet, and the ';parameter=value' syntax (e.g., open=true) to specify route specific parameters.

Methods

Parses a url into a UrlTree

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

UrlTree

Converts a UrlTree into a url

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

string