1 | import { __decorate } from 'tslib';
|
2 | import { DOCUMENT } from '@angular/common';
|
3 | import { NgModule, APP_ID } from '@angular/core';
|
4 | import { BEFORE_APP_SERIALIZED } from '@angular/platform-server';
|
5 | import { hydrateDocument } from '@ionic/core/hydrate';
|
6 |
|
7 |
|
8 | var IonicServerModule = (function () {
|
9 | function IonicServerModule() {
|
10 | }
|
11 | IonicServerModule = __decorate([
|
12 | NgModule({
|
13 | providers: [
|
14 | {
|
15 | provide: BEFORE_APP_SERIALIZED,
|
16 | useFactory: hydrateIonicComponents,
|
17 | multi: true,
|
18 | deps: [DOCUMENT, APP_ID]
|
19 | }
|
20 | ]
|
21 | })
|
22 | ], IonicServerModule);
|
23 | return IonicServerModule;
|
24 | }());
|
25 |
|
26 |
|
27 | function hydrateIonicComponents(doc, appId) {
|
28 | return function () {
|
29 | return hydrateDocument(doc, {
|
30 | clientHydrateAnnotations: false,
|
31 | excludeComponents: [
|
32 |
|
33 | 'ion-action-sheet',
|
34 | 'ion-alert',
|
35 | 'ion-loading',
|
36 | 'ion-modal',
|
37 | 'ion-picker',
|
38 | 'ion-popover',
|
39 | 'ion-toast',
|
40 | 'ion-toast',
|
41 |
|
42 | 'ion-router',
|
43 | 'ion-route',
|
44 | 'ion-route-redirect',
|
45 | 'ion-router-link',
|
46 | 'ion-router-outlet',
|
47 |
|
48 | 'ion-tabs',
|
49 | 'ion-tab',
|
50 |
|
51 | 'ion-picker-column',
|
52 | 'ion-virtual-scroll'
|
53 | ]
|
54 | })
|
55 | .then(function (hydrateResults) {
|
56 | hydrateResults.diagnostics.forEach(function (d) {
|
57 | if (d.type === 'error') {
|
58 | console.error(d.messageText);
|
59 | }
|
60 | else if (d.type === 'debug') {
|
61 | console.debug(d.messageText);
|
62 | }
|
63 | else {
|
64 | console.log(d.messageText);
|
65 | }
|
66 | });
|
67 | if (doc.head != null) {
|
68 | var styleElms = doc.head.querySelectorAll('style[data-styles]');
|
69 | for (var i = 0; i < styleElms.length; i++) {
|
70 | styleElms[i].setAttribute('ng-transition', appId);
|
71 | }
|
72 | }
|
73 | if (doc.body != null) {
|
74 | var ionPages = doc.body.querySelectorAll('.ion-page.ion-page-invisible');
|
75 | for (var i = 0; i < ionPages.length; i++) {
|
76 | ionPages[i].classList.remove('ion-page-invisible');
|
77 | }
|
78 | }
|
79 | });
|
80 | };
|
81 | }
|
82 |
|
83 |
|
84 |
|
85 |
|
86 |
|
87 | export { IonicServerModule, hydrateIonicComponents as ɵa };
|
88 |
|