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

Class ResolveContext

Hierarchy

  • ResolveContext

Index

Constructors

Properties

_nodeFor: Function
_path: Node[]
_pathTo: Function

Methods

  • getOwnResolvables(state: State): Resolvables
  • Gets the resolvables declared on a particular state

  • getResolvables(state?: State, options?: any): Resolvables
  • Gets the available Resolvables for the last element of this path.

  • Gets the available Resolvables for the last element of this path.

    Parameters

    • state Optional: State
      :

      the State (within the ResolveContext's Path) for which to get resolvables

    • options Optional: any
      :

      options.omitOwnLocals: array of property names Omits those Resolvables which are found on the last element of the path.

      This will hide a deepest-level resolvable (by name), potentially exposing a parent resolvable of the same name further up the state tree.

      This is used by Resolvable.resolve() in order to provide the Resolvable access to all the other Resolvables at its own PathElement level, yet disallow that Resolvable access to its own injectable Resolvable.

      This is also used to allow a state to override a parent state's resolve while also injecting that parent state's resolve:

      state({ name: 'G', resolve: { _G: function() { return "G"; } } }); state({ name: 'G.G2', resolve: { _G: function(_G) { return _G + "G2"; } } }); where injecting _G into a controller will yield "GG2"

    Returns Resolvables


  • getResolvablesForFn(fn: IInjectable): object
  • Inspects a function fn for its dependencies. Returns an object containing any matching Resolvables

  • invokeLater(fn: IInjectable, locals?: any, options?: IOptions1): Promise<any>
  • Injects a function given the Resolvables available in the path, from the first node up to the node for the given state.

  • Injects a function given the Resolvables available in the path, from the first node up to the node for the given state.

    First it resolves all the resolvable depencies. When they are done resolving, it invokes the function.

    Parameters

    Returns Promise<any>

    :

    a promise for the return value of the function.


  • invokeNow(fn: IInjectable, locals: any, options?: any): any
  • Immediately injects a function with the dependent Resolvables available in the path, from the first node up to the node for the given state.

  • Immediately injects a function with the dependent Resolvables available in the path, from the first node up to the node for the given state.

    If a Resolvable is not yet resolved, then null is injected in place of the resolvable.

    Parameters

    • fn: IInjectable
    • locals: any
    • options Default value: any = {}

    Returns any

    :

    the return value of the function.


  • resolvePath(options?: IOptions1): Promise<any>

Generated using TypeDoc