| 1011 | * @developerPreview 22.3 |
| 1012 | */ |
| 1013 | export function withErrorBoundaries(options: ErrorBoundaryOptions = {}): ErrorBoundariesFeature { |
| 1014 | const providers = [ |
| 1015 | { |
| 1016 | provide: ROUTER_ERROR_BOUNDARY_HANDLER, |
| 1017 | useFactory: () => |
| 1018 | new ErrorBoundaryHandler(inject(Router), inject(EnvironmentInjector), options), |
| 1019 | }, |
| 1020 | ]; |
| 1021 | return routerFeature(RouterFeatureKind.ErrorBoundariesFeature, providers); |
| 1022 | } |
| 1023 | |
| 1024 | /** |
| 1025 | * A type alias that represents all Router features available for use with `provideRouter`. |