Internal representation of a ng-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]].

Constructors

Properties

$$state: (() => StateObject)
__stateObjectCache: {
    nameGlob: Glob;
}
name: any = undefined
navigable: any = undefined
params: any = undefined
parent: StateObject = undefined
self: any
url: any = undefined

Methods

  • Returns any

    Returns a dot-separated name of the state.

    this does not properly handle dot notation

  • 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: any

      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.

  • Returns a single [[Param]] that is owned by the state

    If opts.inherit is true, it also searches the ancestor states` [[Param]]s.

    Parameters

    • id: any

      the name of the [[Param]] to return

    • opts: {} = {}

      options

      Returns any

    • 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

      • opts: any

        options

      Returns any

    • Predicate which returns true if the object is an internal [[StateObject]] object

      Parameters

      • obj: any

      Returns boolean

    • Predicate which returns true if the object is a [[StateDeclaration]] object

      Parameters

      • obj: any

      Returns boolean