RouterConfigOptions
Extra configuration options that can be used with the withRouterConfig
function.
interface RouterConfigOptions {}
paramsInheritanceStrategy
"emptyOnly" | "always" | undefined
Defines how the router merges parameters, data, and resolved data from parent to child routes.
By default ('emptyOnly'), a route inherits the parent route's parameters when the route itself has an empty path (meaning its configured with path: '') or when the parent route doesn't have any component set.
Set to 'always' to enable unconditional inheritance of parent parameters.
Note that when dealing with matrix parameters, "parent" refers to the parent Route
config which does not necessarily mean the "URL segment to the left". When the Route
path
contains multiple segments, the matrix parameters must appear on the last segment. For example,
matrix parameters for {path: 'a/b', component: MyComp}
should appear as a/b;foo=bar
and not
a;foo=bar/b
.
urlUpdateStrategy
"deferred" | "eager" | undefined
Defines when the router updates the browser URL. By default ('deferred'), update after successful navigation. Set to 'eager' if prefer to update the URL at the beginning of navigation. Updating the URL early allows you to handle a failure of navigation by showing an error message with the URL that failed.
defaultQueryParamsHandling
QueryParamsHandling | undefined
The default strategy to use for handling query params in Router.createUrlTree
when one is not provided.
The createUrlTree
method is used internally by Router.navigate
and RouterLink
.
Note that QueryParamsHandling
does not apply to Router.navigateByUrl
.
When neither the default nor the queryParamsHandling option is specified in the call to createUrlTree
,
the current parameters will be replaced by new parameters.