StateBuilder | UI-Router
Options
All
  • Public
  • Public/Protected
  • All
Menu

Class StateBuilder

internalapi

A internal global service

StateBuilder is a factory for the internal State objects.

When you register a state with the StateRegistry, you register a plain old javascript object which conforms to the StateDeclaration interface. This factory takes that object and builds the corresponding State object, which has an API and is used internally.

Custom properties or API may be added to the internal State object by registering a decorator function using the builder method.

Hierarchy

  • StateBuilder

Index

Constructors

Properties

Methods

Constructors

Properties

builders: Builders

An object that contains all the BuilderFunctions registered, key'd by the name of the State property they build

An object that contains all the BuilderFunctions registered, key'd by the name of the State property they build

matcher: StateMatcher

Methods

  • build(state: State): State
  • Builds all of the properties on an essentially blank State object, returning a State object which has all its properties and API built.

  • Builds all of the properties on an essentially blank State object, returning a State object which has all its properties and API built.

    Parameters

    • state: State
      :

      an uninitialized State object

    Returns State

    :

    the built State object


  • builder(name: string, fn: BuilderFunction): Array<function> | function
  • Registers a BuilderFunction for a specific State property (e.g., parent, url, or path). More than one BuilderFunction can be registered for a given property.

  • Registers a BuilderFunction for a specific State property (e.g., parent, url, or path). More than one BuilderFunction can be registered for a given property.

    The BuilderFunction(s) will be used to define the property on any subsequently built State objects.

    Parameters

    • name: string
      :

      The name of the State property being registered for.

    • fn: BuilderFunction
      :

      The BuilderFunction which will be used to build the State property

    Returns Array<function> | function

    :

    a function which deregisters the BuilderFunction


  • name(state: any): any
  • parentName(state: any): any

Generated using TypeDoc