1 | "use strict";
|
2 | Object.defineProperty(exports, "__esModule", { value: true });
|
3 | exports.registerActivateViews = exports.registerLoadEnteringViews = void 0;
|
4 | var common_1 = require("../common/common");
|
5 | var coreservices_1 = require("../common/coreservices");
|
6 |
|
7 |
|
8 |
|
9 |
|
10 |
|
11 |
|
12 |
|
13 |
|
14 | var loadEnteringViews = function (transition) {
|
15 | var $q = coreservices_1.services.$q;
|
16 | var enteringViews = transition.views('entering');
|
17 | if (!enteringViews.length)
|
18 | return;
|
19 | return $q.all(enteringViews.map(function (view) { return $q.when(view.load()); })).then(common_1.noop);
|
20 | };
|
21 | exports.registerLoadEnteringViews = function (transitionService) {
|
22 | return transitionService.onFinish({}, loadEnteringViews);
|
23 | };
|
24 |
|
25 |
|
26 |
|
27 |
|
28 |
|
29 |
|
30 |
|
31 |
|
32 |
|
33 |
|
34 | var activateViews = function (transition) {
|
35 | var enteringViews = transition.views('entering');
|
36 | var exitingViews = transition.views('exiting');
|
37 | if (!enteringViews.length && !exitingViews.length)
|
38 | return;
|
39 | var $view = transition.router.viewService;
|
40 | exitingViews.forEach(function (vc) { return $view.deactivateViewConfig(vc); });
|
41 | enteringViews.forEach(function (vc) { return $view.activateViewConfig(vc); });
|
42 | $view.sync();
|
43 | };
|
44 | exports.registerActivateViews = function (transitionService) {
|
45 | return transitionService.onSuccess({}, activateViews);
|
46 | };
|
47 |
|
\ | No newline at end of file |