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

Class PathFactory

This class contains functions which convert TargetStates, Nodes and paths from one type to another.

Hierarchy

  • PathFactory

Index

Constructors

Methods

  • bindTransNodesToPath(resolvePath: Node[]): Node[]
  • Given a path, upgrades the path to a Node[]. Each node is assigned a ResolveContext and ParamValues object which is bound to the whole path, but closes over the subpath from root to the node. The views are also added to the node.

  • Given a path, upgrades the path to a Node[]. Each node is assigned a ResolveContext and ParamValues object which is bound to the whole path, but closes over the subpath from root to the node. The views are also added to the node.

    Parameters

    • resolvePath: Node[]

    Returns Node[]


  • buildToPath(fromPath: Node[], targetState: TargetState): Node[]
  • Given a fromPath: Node[] and a TargetState, builds a toPath: Node[]

  • inheritParams(fromPath: Node[], toPath: Node[], toKeys?: string[]): Node[]
  • Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath

  • Given a fromPath and a toPath, returns a new to path which inherits parameters from the fromPath

    For a parameter in a node to be inherited from the from path:

    • The toPath's node must have a matching node in the fromPath (by state).
    • The parameter name must not be found in the toKeys parameter array.

    Note: the keys provided in toKeys are intended to be those param keys explicitly specified by some caller, for instance, $state.transitionTo(..., toParams). If a key was found in toParams, it is not inherited from the fromPath.

    Parameters

    • fromPath: Node[]
    • toPath: Node[]
    • toKeys Default value: string[] = []

    Returns Node[]


  • makeTargetState(path: Node[]): TargetState
  • Given a Node[], create an TargetState

  • subPath(path: Node[], state: any): Node[]
  • Find a subpath of a path that stops at the node for a given state

  • Find a subpath of a path that stops at the node for a given state

    Given an array of nodes, returns a subset of the array starting from the first node, up to the node whose state matches stateName

    Parameters

    • path: Node[]
      :

      a path of Nodes

    • state: any
      :

      the State to stop at

    Returns Node[]


  • treeChanges(fromPath: Node[], toPath: Node[], reloadState: State): TreeChanges
  • Computes the tree changes (entering, exiting) between a fromPath and toPath.

Generated using TypeDoc