UNPKG

2.72 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
8let IonicServerModule = class IonicServerModule {
9};
10IonicServerModule = __decorate([
11 NgModule({
12 providers: [
13 {
14 provide: BEFORE_APP_SERIALIZED,
15 useFactory: hydrateIonicComponents,
16 multi: true,
17 deps: [DOCUMENT, APP_ID]
18 }
19 ]
20 })
21], IonicServerModule);
22// @dynamic
23// tslint:disable-next-line: only-arrow-functions
24function hydrateIonicComponents(doc, appId) {
25 return () => {
26 return hydrateDocument(doc, {
27 clientHydrateAnnotations: false,
28 excludeComponents: [
29 // overlays
30 'ion-action-sheet',
31 'ion-alert',
32 'ion-loading',
33 'ion-modal',
34 'ion-picker',
35 'ion-popover',
36 'ion-toast',
37 'ion-toast',
38 // navigation
39 'ion-router',
40 'ion-route',
41 'ion-route-redirect',
42 'ion-router-link',
43 'ion-router-outlet',
44 // tabs
45 'ion-tabs',
46 'ion-tab',
47 // auxiliar
48 'ion-picker-column',
49 'ion-virtual-scroll'
50 ]
51 })
52 .then(hydrateResults => {
53 hydrateResults.diagnostics.forEach(d => {
54 if (d.type === 'error') {
55 console.error(d.messageText);
56 }
57 else if (d.type === 'debug') {
58 console.debug(d.messageText);
59 }
60 else {
61 console.log(d.messageText);
62 }
63 });
64 if (doc.head != null) {
65 const styleElms = doc.head.querySelectorAll('style[data-styles]');
66 for (let i = 0; i < styleElms.length; i++) {
67 styleElms[i].setAttribute('ng-transition', appId);
68 }
69 }
70 if (doc.body != null) {
71 const ionPages = doc.body.querySelectorAll('.ion-page.ion-page-invisible');
72 for (let i = 0; i < ionPages.length; i++) {
73 ionPages[i].classList.remove('ion-page-invisible');
74 }
75 }
76 });
77 };
78}
79
80/**
81 * Generated bundle index. Do not edit.
82 */
83
84export { IonicServerModule, hydrateIonicComponents as ɵa };
85//# sourceMappingURL=ionic-angular-server.js.map