Skip to content

ui-router-server / matcher / format

Function: format()

ts
function format(matcher, values?): string | null;

Defined in: url-matcher.ts:577

Builds a url from a compiled matcher by substituting parameter values — the inverse of exec, mirroring core's UrlMatcher.format for the supported subset (no parent-matcher composition: matchers here never append). Default values honor the squash policy, search params render as a query string, and values['#'] appends a hash fragment.

Returns null when any value fails its param's validation.

Parameters

ParameterType
matcherCompiledMatcher<unknown>
valuesRawParams

Returns

string | null