Skip to content

Commit 803515f

Browse files
committed
test(angular): update app module
1 parent 6aacb4a commit 803515f

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

packages/angular/test/apps/ng19/src/app/app.module.ts

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,27 +1,23 @@
1-
import { APP_ID, NgModule, PLATFORM_ID } from '@angular/core';
1+
import { APP_ID, NgModule } from '@angular/core';
22
import { BrowserModule } from '@angular/platform-browser';
3-
import { isPlatformBrowser } from '@angular/common';
43
import { RouteReuseStrategy } from '@angular/router';
54
import { IonicModule, IonicRouteStrategy } from '@ionic/angular';
65
import { AppComponent } from './app.component';
76
import { AppRoutingModule } from './app-routing.module';
87

9-
export function ionicConfigFactory(platformId: Object): any {
10-
// Custom keyboard height for lazy loaded app
11-
if (isPlatformBrowser(platformId)) {
12-
const isLazy = window.location.href.includes('lazy');
13-
return isLazy ? { keyboardHeight: 12345 } : {};
14-
}
15-
// Default configuration for non-browser environments
16-
return {};
8+
const isBrowser = typeof window !== 'undefined' && typeof document !== 'undefined';
9+
10+
export function ionicConfigFactory(): any {
11+
const isLazy = isBrowser && window.location.href.includes('lazy');
12+
return isLazy ? { keyboardHeight: 12345 } : {};
1713
}
1814

1915
@NgModule({
2016
declarations: [AppComponent],
2117
imports: [
2218
BrowserModule,
2319
AppRoutingModule,
24-
IonicModule.forRoot(ionicConfigFactory(PLATFORM_ID)),
20+
IonicModule.forRoot(ionicConfigFactory()),
2521
],
2622
providers: [
2723
{ provide: RouteReuseStrategy, useClass: IonicRouteStrategy },

0 commit comments

Comments
 (0)