TargetState | angular-ui-router
Options
Menu

Class TargetState

Encapsulate the target (destination) state/params/options of a Transition.

This class is frequently used to redirect a transition to a new destination.

See:

To create a TargetState, use StateService.target.


This class wraps:

1) an identifier for a state 2) a set of parameters 3) and transition options 4) the registered state object (the StateDeclaration)

Many UI-Router APIs such as StateService.go take a StateOrName argument which can either be a state object (a StateDeclaration or State) or a state name (a string). The TargetState class normalizes those options.

A TargetState may be valid (the state being targeted exists in the registry) or invalid (the state being targeted is not registered).

Hierarchy

  • TargetState

Index

Constructors

Properties

_definition: State

The internal state representation, if exists.

The internal state representation, if exists.

_identifier: StateOrName

An identifier for a state. Either a fully-qualified state name, or the object used to define the state.

An identifier for a state. Either a fully-qualified state name, or the object used to define the state.

_options: TransitionOptions

Transition options.

Transition options.

_params: ParamsOrArray

Methods

  • $state(): State
  • The internal state object (if it was found)

  • error(): string
  • If the object is invalid, returns the reason why

  • exists(): boolean
  • True if the target state was found

  • identifier(): StateOrName
  • The identifier used when creating this TargetState

  • name(): String
  • The name of the state this object targets

  • toString(): string
  • valid(): boolean
  • True if the object is valid

  • isDef(obj: any): boolean
  • Returns true if the object has a state property that might be a state or state name

Generated using TypeDoc