Provides tools for breaking the current and any url to their different parts.
router-x/src/services/url-reflection.service.ts
Properties |
|
Methods |
|
Accessors |
constructor(document: DocumentRef, router: Router, route: ActivatedRoute, config?: RouterXConfig)
|
|||||||||||||||
Parameters:
|
|||||||||||||||
Public forceHttps | ||||||||
forceHttps(url: string)
|
||||||||
Makes sure the url is prefixed with https instead of http.
Parameters:
Returns:
string
The secure url. |
||||||||
Public fragmentOf | ||||||||
fragmentOf(url: string)
|
||||||||
Extracts the fragment from a url.
Parameters:
Example :
Returns:
string
The fragment extracted from the url. |
||||||||
Public queryStringOf | ||||||||
queryStringOf(url: string)
|
||||||||
Extracts the query string of a specified url.
Parameters:
Example :
Returns:
string
The query string extracted from the url. |
||||||||
Public routeOf | ||||||||
routeOf(url: string)
|
||||||||
Extracts the route portion of a given url.
Parameters:
Example :
Returns:
string
The route portion of the url. |
||||||||
Public routeSegmentsOf | ||||||||
routeSegmentsOf(routeOrUrl: string)
|
||||||||
Extracts the route portion of a url as an array of route segments, not including the empty root segment.
Parameters:
Example :
Returns:
string[]
The segments of the route. |
||||||||
Public stripFragment | ||||||||
stripFragment(url: string)
|
||||||||
Removes the fragment portion of a url.
Parameters:
Example :
Returns:
string
The url without the fragment portion. |
||||||||
Public stripQuery | ||||||||
stripQuery(url: string)
|
||||||||
Removes the query portion of a url.
Parameters:
Example :
Returns:
string
The specified url without the query portion. |
||||||||
Public Readonly FragmentRegex |
Default value: /(?<fragment>#.*)$/
|
A regular expression to match the hash sign and everything that follows in a url. The extracted group will be named 'fragment'. |
Public Readonly hostUrl |
Type: string
|
The complete host portion (e.g. https://www.example.com) of the currently navigated url as fetched from the |
Public Readonly route |
Type: ActivatedRoute
|
Public Readonly router |
Type: Router
|
fullUrl |
getfullUrl()
|
The fully qualified url of the currently navigated route (e.g. 'https://some.website.com/some/route?a=1&b=2&c=3#fragment').
Returns:
string
|
routeUrl |
getrouteUrl()
|
The route url of the currently navigated route (e.g. '/some/route').
Returns:
string
|
routeSegments |
getrouteSegments()
|
The segments of the currently navigated route (e.g. ['some', 'route']).
Returns:
string[]
|
queryParams |
getqueryParams()
|
The object representing the query params in the currently navigated route.
Returns:
Params
|
queryString |
getqueryString()
|
The query string portion of the currently navigated route (e.g. '?a=1&b=2&c=3').
Returns:
string
|
fragment |
getfragment()
|
The fragment portion of the currently navigated route, without the hash sign (e.g. 'fragment').
Returns:
string
|
fragmentString |
getfragmentString()
|
The fragment portion of the currently navigated route, with the hash sign (e.g. '#fragment').
Returns:
string
|