UrlTree

Stable

Interface

What it does

Represents the parsed URL.

How to use

@Component({templateUrl:'template.html'}) class MyComponent { constructor(router: Router) { const tree: UrlTree = router.parseUrl('/team/33/(user/victor//support:help)?debug=true#fragment'); const f = tree.fragment; // return 'fragment' const q = tree.queryParams; // returns {debug: 'true'} const g: UrlSegmentGroup = tree.root.children[PRIMARY_OUTLET]; const s: UrlSegment[] = g.segments; // returns 2 segments 'team' and '33' g.children[PRIMARY_OUTLET].segments; // returns 2 segments 'user' and 'victor' g.children['support'].segments; // return 1 segment 'help' } }

Interface Overview

interface UrlTree {
root : UrlSegmentGroup
queryParams : {[key: string]: string}
fragment : string
queryParamMap 
toString() : string

}

Interface Description

Interface Details

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