mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
The `precommitHandler` of the Navigation API unlocks some of the truly powerful features for Routers like Angular's which defer the URL updates. Without the `precommitHandler`, we cannot initiate a navigation until we are ready to commit the URL because it causes the URL to update immediately. With `precommitHandler` support, we are able to create a `NavigateEvent` _immediately_ on navigation, which allows the browser to show that a navigation is happening with a loading indicator. Site visitors will also have the ability to cancel the navigation with the "stop" button. When we are ready to commit the URL, the precommitHandler supports a "redirect" function that we can use to first redirect the navigation to a new location immediately before committing it. The commit operation is not synchronous because the API waits for all precommitHandlers to resolve. This commit adds a small bit of handling to account for this so that the Router's transition does not advance to the next stage until the URL has been committed. |
||
|---|---|---|
| .. | ||
| duplicate_in_flight_navigations.spec.ts | ||
| eager_url_update_strategy.spec.ts | ||
| guards.spec.ts | ||
| integration.spec.ts | ||
| integration_helpers.ts | ||
| lazy_loading.spec.ts | ||
| navigation.spec.ts | ||
| navigation_errors.spec.ts | ||
| redirects.spec.ts | ||
| route_data.spec.ts | ||
| route_reuse_strategy.spec.ts | ||
| router_events.spec.ts | ||
| router_link_active.spec.ts | ||
| router_links.spec.ts | ||