This class returns applicable TransitionHooks for a specific Transition instance.

Hooks (RegisteredHook) may be registered globally, e.g., $transitions.onEnter(...), or locally, e.g. myTransition.onEnter(...). The HookBuilder finds matching RegisteredHooks (where the match criteria is determined by the type of hook)

The HookBuilder also converts RegisteredHooks objects to TransitionHook objects, which are used to run a Transition.

The HookBuilder constructor is given the $transitions service and a Transition instance. Thus, a HookBuilder instance may only be used for one specific Transition object. (side note: the _treeChanges accessor is private in the Transition class, so we must also provide the Transition's _treeChanges)

### Hierarchy

- HookBuilder

## Index

### Constructors

- constructor

### Properties

- transition

### Methods

- buildHooks
- buildHooksForPhase
- getMatchingHooks

## Constructors

- new HookBuilder(transition: Transition): HookBuilder

- #### Parameters

  - ##### transition Transition

  #### Returns HookBuilder

  - Defined in transition/hookBuilder.ts:36

## Properties

transition: Transition

- Defined in transition/hookBuilder.ts:37

## Methods

- buildHooks(hookType: TransitionEventType): TransitionHook[]

- Returns an array of newly built TransitionHook objects.

- Returns an array of newly built TransitionHook objects.

  - Finds all RegisteredHooks registered for the given `hookType` which matched the transition's TreeChanges.
  - Finds PathNode (or `PathNode[]`) to use as the TransitionHook context(s)
  - For each of the PathNodes, creates a TransitionHook

  #### Parameters

  - ##### hookType TransitionEventType

    :

    the type of the hook registration function, e.g., 'onEnter', 'onFinish'.

  #### Returns TransitionHook[]

  - Defined in transition/hookBuilder.ts:56

- buildHooksForPhase(phase: TransitionHookPhase.CREATE | TransitionHookPhase.BEFORE | TransitionHookPhase.RUN | TransitionHookPhase.SUCCESS | TransitionHookPhase.ERROR): TransitionHook[]

- #### Parameters

  - ##### phase TransitionHookPhase.CREATE | TransitionHookPhase.BEFORE | TransitionHookPhase.RUN | TransitionHookPhase.SUCCESS | TransitionHookPhase.ERROR

  #### Returns TransitionHook[]

  - Defined in transition/hookBuilder.ts:39

- getMatchingHooks(hookType: TransitionEventType, treeChanges: TreeChanges): RegisteredHook[]

- Finds all RegisteredHooks from:

  - The Transition object instance hook registry
  - The TransitionService ($transitions) global hook registry

- Finds all RegisteredHooks from:

  - The Transition object instance hook registry
  - The TransitionService ($transitions) global hook registry

  which matched:

  - the eventType
  - the matchCriteria (to, from, exiting, retained, entering)

  #### Parameters

  - ##### hookType TransitionEventType

  - ##### treeChanges TreeChanges

  #### Returns RegisteredHook[]

  :

  an array of matched RegisteredHooks

  - Defined in transition/hookBuilder.ts:105

Generated using TypeDoc