( handler: (error: NavigationError) => unknown | RedirectCommand, )
| 726 | * @publicApi |
| 727 | */ |
| 728 | export function withNavigationErrorHandler( |
| 729 | handler: (error: NavigationError) => unknown | RedirectCommand, |
| 730 | ): NavigationErrorHandlerFeature { |
| 731 | const providers = [ |
| 732 | { |
| 733 | provide: NAVIGATION_ERROR_HANDLER, |
| 734 | useValue: handler, |
| 735 | }, |
| 736 | ]; |
| 737 | return routerFeature(RouterFeatureKind.NavigationErrorHandlerFeature, providers); |
| 738 | } |
| 739 | |
| 740 | /** |
| 741 | * A type alias for providers returned by `withAutoCleanupInjectors` for use with `provideRouter`. |