ExtraOptions
A set of configuration options for a router module, provided in the
forRoot()
method.
interface ExtraOptions extends InMemoryScrollingOptions, RouterConfigOptions {
enableTracing?: boolean
useHash?: boolean
initialNavigation?: InitialNavigation
bindToComponentInputs?: boolean
enableViewTransitions?: boolean
errorHandler?: (error: any) => any
preloadingStrategy?: any
scrollOffset?: [...]
// inherited from router/InMemoryScrollingOptions
anchorScrolling?: 'disabled' | 'enabled'
scrollPositionRestoration?: 'disabled' | 'enabled' | 'top'
// inherited from router/RouterConfigOptions
canceledNavigationResolution?: 'replace' | 'computed'
onSameUrlNavigation?: OnSameUrlNavigation
paramsInheritanceStrategy?: 'emptyOnly' | 'always'
urlUpdateStrategy?: 'deferred' | 'eager'
resolveNavigationPromiseOnError?: boolean
}
See also
Properties
Property | Description |
---|---|
enableTracing?: boolean
|
When true, log all internal navigation events to the console. Use for debugging. |
useHash?: boolean
|
When true, enable the location strategy that uses the URL fragment instead of the history API. |
initialNavigation?: InitialNavigation
|
One of |
bindToComponentInputs?: boolean
|
When true, enables binding information from the |
enableViewTransitions?: boolean
|
When true, enables view transitions in the Router by running the route activation and
deactivation inside of See also: |
errorHandler?: (error: any) => any
|
A custom error handler for failed navigations. If the handler returns a value, the navigation Promise is resolved with this value. If the handler throws an exception, the navigation Promise is rejected with the exception. Deprecated Subscribe to the See also:
|
preloadingStrategy?: any
|
Configures a preloading strategy.
One of |
scrollOffset?: [
number,
number
] | (() => [
number,
number
])
|
Configures the scroll offset the router will use when scrolling to an element. When given a tuple with x and y position value, the router uses that offset each time it scrolls. When given a function, the router invokes the function every time it restores scroll position. |