StateObject | @uirouter/core
Options
All
  • Public
  • Public/Protected
  • All
Menu

Internal representation of a UI-Router state.

Instances of this class are created when a StateDeclaration is registered with the StateRegistry.

A registered StateDeclaration is augmented with a getter ([[StateDeclaration.$$state]]) which returns the corresponding StateObject object.

This class prototypally inherits from the corresponding StateDeclaration. Each of its own properties (i.e., hasOwnProperty) are built using builders from the StateBuilder.

Hierarchy

  • StateObject

Index

Constructors

constructor

Properties

abstract

abstract: boolean

Prototypally inherits from StateDeclaration.abstract

data

data: any

Prototypally inherits from StateDeclaration.data Note: This is the only field on the StateDeclaration which is mutated. The definition object's data field is replaced with a new object which prototypally inherits from the parent state definition's data field.

includes

includes: {}

An object containing the parent States' names as keys and true as their values.

Type declaration

  • [name: string]: boolean

lazyLoad

lazyLoad: (transition: Transition, state: StateDeclaration) => Promise<LazyLoadResult>

Prototypally inherits from StateDeclaration.lazyLoad

Type declaration

name

name: string

The name used to register the state

navigable

navigable: StateObject

The nearest parent StateObject which has a URL

onEnter

Prototypally inherits from StateDeclaration.onEnter

onExit

Prototypally inherits from StateDeclaration.onExit

onRetain

Prototypally inherits from StateDeclaration.onRetain

params

params: {}

The parameters for the state, built from the URL and StateDeclaration.params

Type declaration

parent

parent: StateObject

The parent StateObject

path

path: StateObject[]

The parent StateObject objects from this state up to the root

redirectTo

redirectTo: string | (($transition$: Transition) => TargetState) | { params: {}; state: string | StateDeclaration }

Prototypally inherits from StateDeclaration.redirectTo

resolvables

resolvables: Resolvable[]

A list of Resolvable objects. The internal representation of resolve.

resolve

resolve: {} | any[]

Prototypally inherits from StateDeclaration.resolve

resolvePolicy

resolvePolicy: any

Prototypally inherits from StateDeclaration.resolvePolicy

self

The original StateDeclaration used to build this StateObject. Note: this object also prototypally inherits from the self declaration object.

url

A compiled URLMatcher which detects when the state's URL is matched

views

views: {}

The views for the state. Note: @uirouter/core does not register a builder for views. The framework specific code should register a views builder.

Type declaration

Methods

fqn

  • fqn(): string
  • deprecated

    this does not properly handle dot notation

    Returns string

    Returns a dot-separated name of the state.

is

  • Returns true if the provided parameter is the same state.

    Compares the identity of the state against the passed value, which is either an object reference to the actual State instance, the original definition object passed to $stateProvider.state(), or the fully-qualified name.

    Parameters

    • ref: StateObject | StateDeclaration | string

      Can be one of (a) a State instance, (b) an object that was passed into $stateProvider.state(), (c) the fully-qualified name of a state as a string.

    Returns boolean

    Returns true if ref matches the current State instance.

parameter

  • parameter(id: string, opts?: { inherit?: boolean }): Param
  • Returns a single Param that is owned by the state

    If opts.inherit is true, it also searches the ancestor states` Params.

    Parameters

    • id: string

      the name of the Param to return

    • Default value opts: { inherit?: boolean } = {}

      options

      • Optional inherit?: boolean

    Returns Param

parameters

  • parameters(opts?: { inherit?: boolean; matchingKeys?: any }): Param[]
  • Gets the state's Param objects

    Gets the list of Param objects owned by the state. If opts.inherit is true, it also includes the ancestor states' Param objects. If opts.matchingKeys exists, returns only Params whose id is a key on the matchingKeys object

    Parameters

    • Optional opts: { inherit?: boolean; matchingKeys?: any }

      options

      • Optional inherit?: boolean
      • Optional matchingKeys?: any

    Returns Param[]

root

toString

  • toString(): string

Static create

  • Create a state object to put the private/internal implementation details onto. The object's prototype chain looks like: (Internal State Object) -> (Copy of State.prototype) -> (State Declaration object) -> (State Declaration's prototype...)

    Parameters

    Returns StateObject

    an internal State object

Static isState

  • isState(obj: any): obj is StateObject

Static isStateClass

Static isStateDeclaration

  • isStateDeclaration(obj: any): obj is StateDeclaration

Generated using TypeDoc