Skip to content

lit-ui-router / UiSrefDirective

Class: UiSrefDirective ​

Defined in: packages/lit-ui-router/src/ui-sref.ts:144

Directive class that creates state-based navigation links.

This directive is used internally by the uiSref directive function. It transforms elements (typically <a> tags) into UI-Router navigation links by setting the href attribute and handling click events.

See ​

Extends ​

Properties ​

PropertyTypeDefault valueDescriptionDefined in
hrefstring | nullnullthe href computed for the target, or null when there is nonepackages/lit-ui-router/src/ui-sref.ts:164
optionsTransitionOptions{}the transition options from the last renderpackages/lit-ui-router/src/ui-sref.ts:150
paramsRawParams{}the target state params from the last renderpackages/lit-ui-router/src/ui-sref.ts:148
statestring | nullnullthe target state name from the last renderpackages/lit-ui-router/src/ui-sref.ts:146
targetState| TargetState | nullnullthe resolved target, or null until the router is foundpackages/lit-ui-router/src/ui-sref.ts:166
uiSrefOptionsUiSrefOptions{}this directive's own options, stripped from the transition optionspackages/lit-ui-router/src/ui-sref.ts:161

Methods ​

getOptions() ​

ts
getOptions(opts?): TransitionOptions;

Defined in: packages/lit-ui-router/src/ui-sref.ts:203

the transition options with relative defaulted to the enclosing view

Parameters ​

ParameterType
opts?TransitionOptions

Returns ​

TransitionOptions