PathUtils | @uirouter/react
Options
All
  • Public
  • Public/Protected
  • All
Menu

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

Hierarchy

  • PathUtils

Index

Methods

Static applyViewConfigs

Static buildPath

Static buildToPath

Static equals

  • Returns true if two paths are identical.

    Parameters

    • pathA: PathNode[]
    • pathB: PathNode[]
    • Optional paramsFn: GetParamsFn

      a function which returns the parameters to consider when comparing

    Returns boolean

    true if the the states and parameter values for both paths are identical

Static inheritParams

  • 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

    Returns PathNode[]

Static makeTargetState

Static matching

  • Returns a new path which is: the subpath of the first path which matches the second path.

    The new path starts from root and contains any nodes that match the nodes in the second path. It stops before the first non-matching node.

    Nodes are compared using their state property and their parameter values. If a paramsFn is provided, only the Param returned by the function will be considered when comparing nodes.

    Parameters

    • pathA: PathNode[]

      the first path

    • pathB: PathNode[]

      the second path

    • Optional paramsFn: GetParamsFn

      a function which returns the parameters to consider when comparing

    Returns PathNode[]

    an array of PathNodes from the first path which match the nodes in the second path

Static nonDynamicParams

Static paramValues

Static subPath

Static treeChanges

Generated using TypeDoc