UNPKG

2.87 kBJavaScriptView Raw
1import { __decorate } from 'tslib';
2import { DOCUMENT } from '@angular/common';
3import { NgModule, APP_ID } from '@angular/core';
4import { BEFORE_APP_SERIALIZED } from '@angular/platform-server';
5import { hydrateDocument } from '@ionic/core/hydrate';
6
7// @dynamic
8var IonicServerModule = /** @class */ (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// @dynamic
26// tslint:disable-next-line: only-arrow-functions
27function hydrateIonicComponents(doc, appId) {
28 return function () {
29 return hydrateDocument(doc, {
30 clientHydrateAnnotations: false,
31 excludeComponents: [
32 // overlays
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 // navigation
42 'ion-router',
43 'ion-route',
44 'ion-route-redirect',
45 'ion-router-link',
46 'ion-router-outlet',
47 // tabs
48 'ion-tabs',
49 'ion-tab',
50 // auxiliar
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 * Generated bundle index. Do not edit.
85 */
86
87export { IonicServerModule, hydrateIonicComponents as ɵa };
88//# sourceMappingURL=ionic-angular-server.js.map