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

A internal global service

StateBuilder is a factory for the internal StateObject 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 StateObject object, which has an API and is used internally.

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

Hierarchy

  • StateBuilder

Index

Constructors

Methods

Constructors

constructor

Methods

build

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

    Parameters

    Returns StateObject

    the built State object

builder

  • Registers a BuilderFunction for a specific StateObject 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 StateObject objects.

    Parameters

    • property: string

      The name of the State property being registered for.

    • fn: BuilderFunction

      The BuilderFunction which will be used to build the State property

    Returns Function

    a function which deregisters the BuilderFunction

  • Gets the registered builder functions for a given property of StateObject.

    Parameters

    • property: string

      The name of the State property being registered for.

    Returns BuilderFunction | BuilderFunction[]

    the registered builder(s). note: for backwards compatibility, this may be a single builder or an array of builders

name

parentName

Generated using TypeDoc