W3cubDocs

/Angular

RedirectFunction

The type for the function that can be used to handle redirects when the path matches a Route config.

API

type RedirectFunction = (
  redirectData: PartialMatchRouteSnapshot,
) => MaybeAsync<string | UrlTree>

Description

The type for the function that can be used to handle redirects when the path matches a Route config.

The RedirectFunction does not have access to the full ActivatedRouteSnapshot interface because Route matching has not yet completed when the function is called. See PartialMatchRouteSnapshot for more information.

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/router/RedirectFunction