angular/packages/router/test
Andrew Scott b2790813a6 fix(router): Align RouterModule.forRoot errorHandler with provider error handler (#57050)
This change aligns the behavior of the error handler in the
`ExtraOptions` of `RouterModule.forRoot` with the error handler in
`withNavigationErrorHandler`. The changes are:

* Slightly different timing: The handler is called before the
  `NavigationError` emits
* Runs in the injection context, meaning it is more configurable at the
  config location rather than needing to assign the value to the
  `Router.errorHandler` later to get access to injectables
* Can now return `RedirectCommand` to recover from the error and
  redirect without emitting `NavigationError`
* No longer allows arbitrarily overriding return value of the navigation
  promise

BREAKING CHANGE: The `Router.errorHandler` property has been removed.
Adding an error handler should be configured in either
`withNavigationErrorHandler` with `provideRouter` or the `errorHandler`
property in the extra options of `RouterModule.forRoot`. In addition,
the error handler cannot be used to change the return value of the
router navigation promise or prevent it from rejecting. Instead, if you
want to prevent the promise from rejecting, use `resolveNavigationPromiseOnError`.

PR Close #57050
2024-08-12 09:28:08 -07:00
..
directives feat(router): Add routerOutletData input to RouterOutlet directive (#57051) 2024-08-09 08:08:26 -07:00
operators refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
utils refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
apply_redirects.spec.ts feat(router): Allow Route.redirectTo to be a function which returns a string or UrlTree (#52606) 2024-03-14 11:19:01 -07:00
bootstrap.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
BUILD.bazel fix(router): Ensure title observable gets latest values (#51561) 2023-08-31 16:42:44 +00:00
computed_state_restoration.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
config.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
create_router_state.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
create_url_tree.spec.ts feat(router): Add defaultQueryParamsHandling to router configuration (#57198) 2024-08-02 15:11:38 +00:00
default_export_component.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
default_export_routes.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
helpers.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
integration.spec.ts fix(router): Align RouterModule.forRoot errorHandler with provider error handler (#57050) 2024-08-12 09:28:08 -07:00
page_title_strategy_spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
recognize.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
regression_integration.spec.ts fix(router): Navigations triggered by cancellation events should cancel previous navigation (#54710) 2024-03-07 13:07:08 -08:00
router.spec.ts fix(router): Routed components never inherit RouterOutlet EnvironmentInjector (#54265) 2024-04-01 09:19:13 -07:00
router_link_active.spec.ts fix(router): RouterLinkActive will always remove active classes when links are not active (#54982) 2024-03-27 10:16:16 -07:00
router_link_spec.ts feat(router): Allow UrlTree as an input to routerLink (#56265) 2024-06-07 09:33:14 -07:00
router_navigation_extras.spec.ts fix(router): preserve replaceUrl when returning a urlTree from CanActivate (#54042) 2024-03-27 10:57:52 -07:00
router_preloader.spec.ts feat(core): bootstrapModule can configure NgZone in providers (#57060) 2024-07-30 18:03:35 +00:00
router_scroller.spec.ts fix(router): Scroller should scroll as soon as change detection completes (#55105) 2024-04-30 09:19:06 -07:00
router_state.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
shared.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
standalone.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
url_serializer.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
url_tree.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00
view_transitions.spec.ts refactor: migrate router to prettier formatting (#54318) 2024-02-08 19:17:14 +00:00