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

External module hooks

Index

Variables

onEnterHook: TransitionStateHookFn

The TransitionStateHookFn for onEnter

The TransitionStateHookFn for onEnter

When the state is being entered, the state's .onEnter function is invoked.

Registered using transitionService.onEnter({ entering: (state) => !!state.onEnter }, onEnterHook);

See: IHookRegistry.onEnter

onExitHook: TransitionStateHookFn

The TransitionStateHookFn for onExit

The TransitionStateHookFn for onExit

When the state is being exited, the state's .onExit function is invoked.

Registered using transitionService.onExit({ exiting: (state) => !!state.onExit }, onExitHook);

See: IHookRegistry.onExit

onRetainHook: TransitionStateHookFn

The TransitionStateHookFn for onRetain

The TransitionStateHookFn for onRetain

When the state was already entered, and is not being exited or re-entered, the state's .onRetain function is invoked.

Registered using transitionService.onRetain({ retained: (state) => !!state.onRetain }, onRetainHook);

See: IHookRegistry.onRetain

Functions

  • A TransitionHookFn which activates the new views when a transition is successful.

    Registered using transitionService.onSuccess({}, activateViews);

    After a transition is complete, this hook deactivates the old views from the previous state, and activates the new views from the destination state.

    See ViewService

    Parameters

    Returns void


  • A TransitionHookFn which resolves all EAGER Resolvables in the To Path

    Registered using transitionService.onStart({}, eagerResolvePath);

    When a Transition starts, this hook resolves all the EAGER Resolvables, which the transition then waits for.

    See StateDeclaration.resolve

    Parameters

    Returns Promise<any>


  • A TransitionHookFn that lazy loads a state tree.

    When transitioning to a state "abc" which has a lazyLoad function defined:

    • Invoke the lazyLoad function
      • The function should return a promise for an array of lazy loaded StateDeclarations
    • Wait for the promise to resolve
    • Deregister the original state "abc"
      • The original state definition is a placeholder for the lazy loaded states
    • Register the new states
    • Retry the transition

    See StateDeclaration.lazyLoad

    Parameters

    Returns any


  • lazyResolveState(trans: Transition, state: State): Promise<any>
  • A TransitionHookFn which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path

  • A TransitionHookFn which resolves all LAZY Resolvables for the state (and all its ancestors) in the To Path

    Registered using transitionService.onEnter({ entering: () => true }, lazyResolveState);

    When a State is being entered, this hook resolves all the Resolvables for this state, which the transition then waits for.

    See StateDeclaration.resolve

    Parameters

    Returns Promise<any>


  • A TransitionHookFn which waits for the views to load

    Registered using transitionService.onStart({}, loadEnteringViews);

    Allows the views to do async work in ViewConfig.load before the transition continues. In angular 1, this includes loading the templates.

    Parameters

    Returns Promise<any>


  • A TransitionHookFn which updates the URL after a successful transition

    Registered using transitionService.onSuccess({}, updateUrl);

    Parameters

    Returns void


Generated using TypeDoc