DefaultUrlSerializer

A default implementation of the UrlSerializer.

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

说明

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.

方法

Parses a url into a UrlTree

parse(url: string): UrlTree

参数

url

Type: string.

返回值

UrlTree

Converts a UrlTree into a url

serialize(tree: UrlTree): string

参数

tree

Type: UrlTree.

返回值

string