mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2025-08-16 01:52:19 +08:00
style(angular-server): add eslint and prettier (#24126)
This commit is contained in:
@ -10,15 +10,15 @@ import { hydrateDocument } from '@ionic/core/hydrate';
|
||||
provide: BEFORE_APP_SERIALIZED,
|
||||
useFactory: hydrateIonicComponents,
|
||||
multi: true,
|
||||
deps: [DOCUMENT, APP_ID]
|
||||
}
|
||||
]
|
||||
deps: [DOCUMENT, APP_ID],
|
||||
},
|
||||
],
|
||||
})
|
||||
export class IonicServerModule {}
|
||||
|
||||
// @dynamic
|
||||
// tslint:disable-next-line: only-arrow-functions
|
||||
export function hydrateIonicComponents(doc: any, appId: any) {
|
||||
// eslint-disable-next-line @typescript-eslint/explicit-module-boundary-types
|
||||
return () => {
|
||||
return hydrateDocument(doc, {
|
||||
clientHydrateAnnotations: false,
|
||||
@ -46,11 +46,10 @@ export function hydrateIonicComponents(doc: any, appId: any) {
|
||||
|
||||
// auxiliar
|
||||
'ion-picker-column',
|
||||
'ion-virtual-scroll'
|
||||
]
|
||||
})
|
||||
.then(hydrateResults => {
|
||||
hydrateResults.diagnostics.forEach(d => {
|
||||
'ion-virtual-scroll',
|
||||
],
|
||||
}).then((hydrateResults) => {
|
||||
hydrateResults.diagnostics.forEach((d) => {
|
||||
if (d.type === 'error') {
|
||||
console.error(d.messageText);
|
||||
} else if (d.type === 'debug') {
|
||||
@ -62,6 +61,7 @@ export function hydrateIonicComponents(doc: any, appId: any) {
|
||||
|
||||
if (doc.head != null) {
|
||||
const styleElms = doc.head.querySelectorAll('style[data-styles]') as NodeListOf<HTMLStyleElement>;
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
for (let i = 0; i < styleElms.length; i++) {
|
||||
styleElms[i].setAttribute('ng-transition', appId);
|
||||
}
|
||||
@ -69,6 +69,7 @@ export function hydrateIonicComponents(doc: any, appId: any) {
|
||||
|
||||
if (doc.body != null) {
|
||||
const ionPages = doc.body.querySelectorAll('.ion-page.ion-page-invisible') as NodeListOf<HTMLElement>;
|
||||
// eslint-disable-next-line @typescript-eslint/prefer-for-of
|
||||
for (let i = 0; i < ionPages.length; i++) {
|
||||
ionPages[i].classList.remove('ion-page-invisible');
|
||||
}
|
||||
|
Reference in New Issue
Block a user