Represents a single URL segment.
@Component({templateUrl:'template.html'}) class MyComponent { constructor(router: Router) { const tree: UrlTree = router.parseUrl('/team;id=33'); const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; const s: UrlSegment[] = g.segments; s[0].path; // returns 'team' s[0].parameters; // returns {id: 33} } }
class UrlSegment { constructor(path: string, parameters: {[name: string]: string}) path : string parameters : {[name: string]: string} parameterMap toString() : string }
A UrlSegment is a part of a URL between the two slashes. It contains a path and the matrix parameters associated with the segment.
constructor(path: string, parameters: {[name: string]: string})
path : string
The path part of a URL segment
parameters : {[name: string]: string}
The matrix parameters associated with a segment
parameterMap
toString() : string
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/UrlSegment-class.html