docs: update extra options available for RouterModule.forRoot() method (#29846)

PR Close #29846
This commit is contained in:
Brandon 2019-04-11 12:58:44 -05:00 committed by Ben Lesh
parent e1f51eaa55
commit 78146c1890

View File

@ -143,18 +143,32 @@ export class RouterModule {
* Creates a module with all the router providers and directives. It also optionally sets up an * Creates a module with all the router providers and directives. It also optionally sets up an
* application listener to perform an initial navigation. * application listener to perform an initial navigation.
* *
* Options (see `ExtraOptions`): * Configuration Options:
* * `enableTracing` makes the router log all its internal events to the console. *
* * `useHash` enables the location strategy that uses the URL fragment instead of the history * * `enableTracing` Toggles whether the router should log all navigation events to the console.
* * `useHash` Enables the location strategy that uses the URL fragment instead of the history
* API. * API.
* * `initialNavigation` disables the initial navigation. * * `initialNavigation` Disables the initial navigation.
* * `errorHandler` provides a custom error handler. * * `errorHandler` Defines a custom error handler for failed navigations.
* * `preloadingStrategy` configures a preloading strategy (see `PreloadAllModules`). * * `preloadingStrategy` Configures a preloading strategy. See `PreloadAllModules`.
* * `onSameUrlNavigation` configures how the router handles navigation to the current URL. See * * `onSameUrlNavigation` Define what the router should do if it receives a navigation request to
* `ExtraOptions` for more details. * the current URL.
* * `paramsInheritanceStrategy` defines how the router merges params, data and resolved data * * `scrollPositionRestoration` Configures if the scroll position needs to be restored when
* from parent to child routes. * navigating back.
*/ * * `anchorScrolling` Configures if the router should scroll to the element when the url has a
* fragment.
* * `scrollOffset` Configures the scroll offset the router will use when scrolling to an element.
* * `paramsInheritanceStrategy` Defines how the router merges params, data and resolved data from
* parent to child routes.
* * `malformedUriErrorHandler` Defines a custom malformed uri error handler function. This
* handler is invoked when encodedURI contains invalid character sequences.
* * `urlUpdateStrategy` Defines when the router updates the browser URL. The default behavior is
* to update after successful navigation.
* * `relativeLinkResolution` Enables the correct relative link resolution in components with
* empty paths.
*
* See `ExtraOptions` for more details about the above options.
*/
static forRoot(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterModule> { static forRoot(routes: Routes, config?: ExtraOptions): ModuleWithProviders<RouterModule> {
return { return {
ngModule: RouterModule, ngModule: RouterModule,