PathFactory | ui-router-ng2
Options
Menu

Class PathFactory

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

Hierarchy

  • PathFactory

Index

Constructors

Methods

  • applyViewConfigs($view: ViewService, path: PathNode[], states: State[]): void
  • Creates ViewConfig objects and adds to nodes.

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

  • inheritParams(fromPath: PathNode[], toPath: PathNode[], toKeys?: string[]): PathNode[]
  • 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

    Returns PathNode[]


  • paramValues(path: PathNode[]): object
  • Gets the raw parameter values from a path

  • subPath(path: PathNode[], predicate: Predicate): PathNode[]
  • Return a subpath of a path, which stops at the first matching node

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

Generated using TypeDoc