AngularTS
    Preparing search index...

    Type Alias TransitionStateHookFn

    TransitionStateHookFn: (
        transition: Transition,
        state: StateDeclaration,
    ) => HookResult

    The signature for State Transition Hooks.

    State hooks are registered as onEnter/onRetain/onExit in state declarations. State hooks can additionally be injected with $transitions and $states for the current [[Transition]] and [[StateObject]] in the transition.

    Transition State Hooks are callback functions that hook into the lifecycle events of specific states during a transition. As a transition runs, it may exit some states, retain (keep) states, and enter states. As each lifecycle event occurs, the hooks which are registered for the event and that state are called (in priority order).

    • [[HookRegistry.onExit]]
    • [[HookRegistry.onRetain]]
    • [[HookRegistry.onEnter]]
    onEnter: function() { console.log('Entering'); }
    

    Not minification-safe

    onRetain: function($state$) { console.log('Retained ' + $state$.name); }
    

    Annotated for minification-safety

    onExit: [ '$transition$', '$state', function($transition$, $state) {
    // always redirect to 'foo' state when being exited
    if ($transition$.to().name !== 'foo') {
    return $state.target('foo');
    }
    } ]

    Type Declaration