Skip to content

ui-router-server / redirects / RouteDeclaration

Interface: RouteDeclaration ​

Defined in: redirects.ts:39

A state's contribution to the url-addressable route set.

Properties ​

PropertyTypeDescriptionDefined in
delegate?stringNames the host handler that answers this state's url, for any method and any Accept: the verdict is delegate instead of shell. The state tree stays isomorphic because it carries only the key; the adapter's delegates option maps the key to a handler. A delegating state needs a url and no redirectTo, and no redirect may target it. Child states don't inherit it.redirects.ts:78
namestringThe state name; dotted names nest under their parent, as in ui-router.redirects.ts:41
params?Record<string, unknown>Param declarations for this state's own placeholders (shorthand defaults or ParamDeclarations).redirects.ts:52
parent?stringThe parent state's name, as core's StateDeclaration.parent: the state nests under it instead of under its dotted prefix. A dotted name with a parent is rejected at compile, as core rejects it at registration.redirects.ts:47
redirectStatusCode?RedirectStatusCodeThe status this state's redirectTo answers with, data or function, when a url lands on it: in the verdict for a data redirectTo, and in `redirectedTo` after settle. Defaults to 302, since a permanent redirect is cached by browsers with no expiry; a redirect that never changes declares 308. A pattern rule's redirect stays 302.redirects.ts:69
redirectTo?string | RedirectTargetData redirect, mirroring ui-router's redirectTo subset: a url landing on this state goes to the target state instead. A string target keeps the matched params; a RedirectTarget with params replaces them (core's result.params || trans.params()). Chains are followed; cycles are rejected at compile.redirects.ts:60
response?trueMarks a response state: its url answers with the Response a handler bound to the state's name builds from its resolves (a redirect, JSON, a badge) instead of a page, and the verdict is response instead of shell. The tree carries only the marker, so client bundles never import the handler. A response state needs a url and no redirectTo, and can't also delegate. Child states don't inherit it.redirects.ts:87
url?stringUrl segment appended to the ancestors' segments; a url-less state is structural only (never matched, never a redirect target).redirects.ts:49