This class provides services related to Transitions.

  • Most importantly, it allows global Transition Hooks to be registered.
  • It allows the default transition error handler to be set.
  • It also has a factory function for creating new [[Transition]] objects, (used internally by the [[StateService]]).

At bootstrap, [[UIRouter]] creates a single instance (singleton) of this class.

This API is located at router.transitionService ([[UIRouter.transitionService]])

Constructors

Properties

$get: (string | ((stateService: any, urlService: any, stateRegistry: any, viewService: any) => TransitionService))[] = ...
$view: any
_criteriaPaths: {}

The paths on a criteria object

_deregisterHookFns: {}
_eventTypes: any[]

The transition hook types, such as onEnter, onStart, etc

_pluginapi: any
_registeredHooks: {}

The registered transition hooks

_transitionCount: number
$inject: string[] = ...

Methods

  • Parameters

    • name: any
    • hookPhase: any
    • hookOrder: any
    • criteriaMatchPath: any
    • reverseSort: boolean = false
    • getResultHandler: ((hook: any) => ((result: any) => any)) = TransitionHook.HANDLE_RESULT
        • (hook): ((result: any) => any)
        • These GetResultHandler(s) are used by [[invokeHook]] below Each HookType chooses a GetResultHandler (See: [[TransitionService._defineCoreEvents]])

          Parameters

          • hook: any

          Returns ((result: any) => any)

            • (result): any
            • Parameters

              • result: any

              Returns any

    • getErrorHandler: (() => ((error: any) => any)) = TransitionHook.REJECT_ERROR
        • (): ((error: any) => any)
        • Returns ((error: any) => any)

            • (error): any
            • Parameters

              • error: any

              Returns any

    • synchronous: boolean = false

    Returns void

  • Internal

    Adds a Path to be used as a criterion against a TreeChanges path

    For example: the exiting path in [[HookMatchCriteria]] is a STATE scoped path. It was defined by calling defineTreeChangesCriterion('exiting', TransitionHookScope.STATE) Each state in the exiting path is checked against the criteria and returned as part of the match.

    Another example: the to path in [[HookMatchCriteria]] is a TRANSITION scoped path. It was defined by calling defineTreeChangesCriterion('to', TransitionHookScope.TRANSITION) Only the tail of the to path is checked against the criteria and returned as part of the match.

    Parameters

    • name: any
    • hookScope: any

    Returns void

  • Internal

    Creates a new [[Transition]] object

    This is a factory function for creating new Transition objects. It is used internally by the [[StateService]] and should generally not be called by application code.

    Parameters

    • fromPath: any

      the path to the current state (the from state)

    • targetState: any

      the target state (destination)

    Returns Transition

    a Transition