State | angular-ui-router
Options
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 State 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

  • State

Index

Constructors

Properties

abstract: boolean

Prototypally inherits from StateDeclaration.abstract

Prototypally inherits from StateDeclaration.abstract

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.

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: object

An array of strings of the parent States' names

An array of strings of the parent States' names

Type declaration

  • [name: string]: boolean
lazyLoad: function

Prototypally inherits from StateDeclaration.lazyLoad

Prototypally inherits from StateDeclaration.lazyLoad

Type declaration

name: string

The name used to register the state

The name used to register the state

navigable: State

The nearest parent State which has a URL

The nearest parent State which has a URL

onEnter: TransitionStateHookFn

Prototypally inherits from StateDeclaration.onEnter

Prototypally inherits from StateDeclaration.onEnter

onExit: TransitionStateHookFn

Prototypally inherits from StateDeclaration.onExit

Prototypally inherits from StateDeclaration.onExit

onRetain: TransitionStateHookFn

Prototypally inherits from StateDeclaration.onRetain

Prototypally inherits from StateDeclaration.onRetain

params: object

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

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

Type declaration

parent: State

The parent State

The parent State

path: State[]

The parent State objects from this state up to the root

The parent State objects from this state up to the root

redirectTo: string | function | object

Prototypally inherits from StateDeclaration.redirectTo

Prototypally inherits from StateDeclaration.redirectTo

resolvables: Resolvable[]

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

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

resolve: Array<any> | object

Prototypally inherits from StateDeclaration.resolve

Prototypally inherits from StateDeclaration.resolve

resolvePolicy: any

Prototypally inherits from StateDeclaration.resolvePolicy

Prototypally inherits from StateDeclaration.resolvePolicy

self: StateDeclaration

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

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

url: UrlMatcher

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

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

views: object

The views for the state. Note: ui-router-core does not register a builder for views. The framework specific code should register a views builder.

The views for the state. Note: ui-router-core does not register a builder for views. The framework specific code should register a views builder.

Type declaration

Methods

  • fqn(): string
  • is(ref: State | StateDeclaration | string): boolean
  • Returns true if the provided parameter is the same state.

  • 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 State | 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(id: string, opts?: object): Param
  • Returns a single Param that is owned by the state

  • Returns a single Param that is owned by the state

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

    Parameters

    • id string
      :

      the name of the Param to return

    • opts: Default value  object = {}
      :

      options

      • Optional inherit?: boolean

    Returns Param


  • parameters(opts?: object): Param[]
  • Gets the state's Parameters

  • Gets the state's Parameters

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

    Parameters

    • opts: Optional  object
      :

      options

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

    Returns Param[]


  • root(): State
  • Returns the root node of this state's tree.

  • toString(): string

Generated using TypeDoc