@@ -268,6 +268,7 @@ export interface IHookRegistry {
268268 * See [[TransitionHookFn]] for the signature of the function.
269269 *
270270 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
271+ * To match all Transitions, use an empty criteria object `{}`.
271272 *
272273 * ### Lifecycle
273274 *
@@ -364,6 +365,7 @@ export interface IHookRegistry {
364365 * See [[TransitionHookFn]] for the signature of the function.
365366 *
366367 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
368+ * To match all Transitions, use an empty criteria object `{}`.
367369 *
368370 * ### Lifecycle
369371 *
@@ -397,7 +399,7 @@ export interface IHookRegistry {
397399 * @example
398400 * ```js
399401 * // ng1
400- * $transitions.onStart( { to: 'auth.*' }, function(trans) {
402+ * $transitions.onStart( { to: 'auth.** ' }, function(trans) {
401403 * var $state = trans.router.stateService;
402404 * var MyAuthService = trans.injector().get('MyAuthService');
403405 *
@@ -436,9 +438,7 @@ export interface IHookRegistry {
436438 *
437439 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
438440 * `onEnter` hooks generally specify `{ entering: 'somestate' }`.
439- *
440- * The `matchCriteria` is used to determine which Transitions the hook should be invoked during.
441- * Note: for `onEnter` hooks, the `to` in the `matchCriteria` matches the entering state, not the Transition "to state".
441+ * To match all Transitions, use an empty criteria object `{}`.
442442 *
443443 * ### Lifecycle
444444 *
@@ -508,8 +508,9 @@ export interface IHookRegistry {
508508 * This hook can be used to perform actions when the user moves from one substate to another, such as
509509 * between steps in a wizard.
510510 *
511- * The `matchCriteria` is used to determine which Transitions the hook should be invoked during .
511+ * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for .
512512 * `onRetain` hooks generally specify `{ retained: 'somestate' }`.
513+ * To match all Transitions, use an empty criteria object `{}`.
513514 *
514515 * ### Lifecycle
515516 *
@@ -548,6 +549,7 @@ export interface IHookRegistry {
548549 *
549550 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
550551 * `onExit` hooks generally specify `{ exiting: 'somestate' }`.
552+ * To match all Transitions, use an empty criteria object `{}`.
551553 *
552554 * ### Lifecycle
553555 *
@@ -583,6 +585,7 @@ export interface IHookRegistry {
583585 * See [[TransitionHookFn]] for the signature of the function.
584586 *
585587 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
588+ * To match all Transitions, use an empty criteria object `{}`.
586589 *
587590 * ### Lifecycle
588591 *
@@ -609,6 +612,7 @@ export interface IHookRegistry {
609612 * See [[TransitionHookFn]] for the signature of the function.
610613 *
611614 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
615+ * To match all Transitions, use an empty criteria object `{}`.
612616 *
613617 * ### Lifecycle
614618 *
@@ -635,6 +639,7 @@ export interface IHookRegistry {
635639 * See [[TransitionHookFn]] for the signature of the function.
636640 *
637641 * The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
642+ * To match all Transitions, use an empty criteria object `{}`.
638643 *
639644 * ### Lifecycle
640645 *
@@ -689,10 +694,11 @@ export type IStateMatch = Predicate<State>
689694 * This object is used to configure whether or not a Transition Hook is invoked for a particular transition,
690695 * based on the Transition's "to state" and "from state".
691696 *
692- * Each property (`to`, `from`, `exiting`, `retained`, and `entering`) can be state globs, a function that takes a
693- * state , or a boolean (see [[HookMatchCriterion]])
697+ * Each property (`to`, `from`, `exiting`, `retained`, and `entering`) can be a state [[Glob]] string,
698+ * a boolean , or a function that takes a state and returns a boolean (see [[HookMatchCriterion]])
694699 *
695700 * All properties are optional. If any property is omitted, it is replaced with the value `true`, and always matches.
701+ * To match any transition, use an empty criteria object `{}`.
696702 *
697703 * @example
698704 * ```js
@@ -774,7 +780,7 @@ export interface IMatchingNodes {
774780 * Or, a function with the signature `function(state) { return matches; }`
775781 * which should return a boolean to indicate if a state matches.
776782 *
777- * Or, `true` to match anything
783+ * Or, `true` to always match
778784 */
779785export type HookMatchCriterion = ( string | IStateMatch | boolean )
780786
0 commit comments