@@ -268,6 +268,7 @@ export interface IHookRegistry {
268
268
* See [[TransitionHookFn]] for the signature of the function.
269
269
*
270
270
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
271
+ * To match all Transitions, use an empty criteria object `{}`.
271
272
*
272
273
* ### Lifecycle
273
274
*
@@ -364,6 +365,7 @@ export interface IHookRegistry {
364
365
* See [[TransitionHookFn]] for the signature of the function.
365
366
*
366
367
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
368
+ * To match all Transitions, use an empty criteria object `{}`.
367
369
*
368
370
* ### Lifecycle
369
371
*
@@ -397,7 +399,7 @@ export interface IHookRegistry {
397
399
* @example
398
400
* ```js
399
401
* // ng1
400
- * $transitions.onStart( { to: 'auth.*' }, function(trans) {
402
+ * $transitions.onStart( { to: 'auth.** ' }, function(trans) {
401
403
* var $state = trans.router.stateService;
402
404
* var MyAuthService = trans.injector().get('MyAuthService');
403
405
*
@@ -436,9 +438,7 @@ export interface IHookRegistry {
436
438
*
437
439
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
438
440
* `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 `{}`.
442
442
*
443
443
* ### Lifecycle
444
444
*
@@ -508,8 +508,9 @@ export interface IHookRegistry {
508
508
* This hook can be used to perform actions when the user moves from one substate to another, such as
509
509
* between steps in a wizard.
510
510
*
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 .
512
512
* `onRetain` hooks generally specify `{ retained: 'somestate' }`.
513
+ * To match all Transitions, use an empty criteria object `{}`.
513
514
*
514
515
* ### Lifecycle
515
516
*
@@ -548,6 +549,7 @@ export interface IHookRegistry {
548
549
*
549
550
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
550
551
* `onExit` hooks generally specify `{ exiting: 'somestate' }`.
552
+ * To match all Transitions, use an empty criteria object `{}`.
551
553
*
552
554
* ### Lifecycle
553
555
*
@@ -583,6 +585,7 @@ export interface IHookRegistry {
583
585
* See [[TransitionHookFn]] for the signature of the function.
584
586
*
585
587
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
588
+ * To match all Transitions, use an empty criteria object `{}`.
586
589
*
587
590
* ### Lifecycle
588
591
*
@@ -609,6 +612,7 @@ export interface IHookRegistry {
609
612
* See [[TransitionHookFn]] for the signature of the function.
610
613
*
611
614
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
615
+ * To match all Transitions, use an empty criteria object `{}`.
612
616
*
613
617
* ### Lifecycle
614
618
*
@@ -635,6 +639,7 @@ export interface IHookRegistry {
635
639
* See [[TransitionHookFn]] for the signature of the function.
636
640
*
637
641
* The [[HookMatchCriteria]] is used to determine which Transitions the hook should be invoked for.
642
+ * To match all Transitions, use an empty criteria object `{}`.
638
643
*
639
644
* ### Lifecycle
640
645
*
@@ -689,10 +694,11 @@ export type IStateMatch = Predicate<State>
689
694
* This object is used to configure whether or not a Transition Hook is invoked for a particular transition,
690
695
* based on the Transition's "to state" and "from state".
691
696
*
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]])
694
699
*
695
700
* 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 `{}`.
696
702
*
697
703
* @example
698
704
* ```js
@@ -774,7 +780,7 @@ export interface IMatchingNodes {
774
780
* Or, a function with the signature `function(state) { return matches; }`
775
781
* which should return a boolean to indicate if a state matches.
776
782
*
777
- * Or, `true` to match anything
783
+ * Or, `true` to always match
778
784
*/
779
785
export type HookMatchCriterion = ( string | IStateMatch | boolean )
780
786
0 commit comments