W3cubDocs

/Angular 12

UrlSerializer

class

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
}

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

© 2010–2021 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://v12.angular.io/api/router/UrlSerializer