1 | ;
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.registerInvalidTransitionHook = void 0;
|
4 | /**
|
5 | * A [[TransitionHookFn]] that rejects the Transition if it is invalid
|
6 | *
|
7 | * This hook is invoked at the end of the onBefore phase.
|
8 | * If the transition is invalid (for example, param values do not validate)
|
9 | * then the transition is rejected.
|
10 | */
|
11 | function invalidTransitionHook(trans) {
|
12 | if (!trans.valid()) {
|
13 | throw new Error(trans.error().toString());
|
14 | }
|
15 | }
|
16 | exports.registerInvalidTransitionHook = function (transitionService) {
|
17 | return transitionService.onBefore({}, invalidTransitionHook, { priority: -10000 });
|
18 | };
|
19 | //# sourceMappingURL=invalidTransition.js.map |
\ | No newline at end of file |