MCPcopy Create free account
hub / github.com/angular/angular / withNavigationErrorHandler

Function withNavigationErrorHandler

packages/router/src/provide_router.ts:721–731  ·  view source on GitHub ↗
(
  handler: (error: NavigationError) => unknown | RedirectCommand,
)

Source from the content-addressed store, hash-verified

719 * @publicApi
720 */
721export function withNavigationErrorHandler(
722 handler: (error: NavigationError) => unknown | RedirectCommand,
723): NavigationErrorHandlerFeature {
724 const providers = [
725 {
726 provide: NAVIGATION_ERROR_HANDLER,
727 useValue: handler,
728 },
729 ];
730 return routerFeature(RouterFeatureKind.NavigationErrorHandlerFeature, providers);
731}
732
733/**
734 * A type alias for providers returned by `withExperimentalAutoCleanupInjectors` for use with `provideRouter`.

Calls 1

routerFeatureFunction · 0.85

Tested by 1