DefaultUrlSerializer

DefaultUrlSerializer

Stable Class

What it does

A default implementation of the UrlSerializer.

Class Overview

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

Class 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.

Class Details

parse(url: string) : UrlTree

Parses a url into a UrlTree

serialize(tree: UrlTree) : string

Converts a UrlTree into a url

exported from router-index, defined in router/src/url_tree.ts

© 2010–2017 Google, Inc.
Licensed under the Creative Commons Attribution License 4.0.
https://angular.io/docs/ts/latest/api/router/index/DefaultUrlSerializer-class.html

在线笔记
App下载
App下载

扫描二维码

下载编程狮App

公众号
微信公众号

编程狮公众号

意见反馈
返回顶部