Compare commits
1
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
54bd869042 |
+4
-3
@@ -1,4 +1,5 @@
|
||||
import { APP_ID, APP_INITIALIZER, isPlatformServer, PlatformId } from '@angular/core';
|
||||
import { APP_ID, APP_INITIALIZER, PLATFORM_ID } from '@angular/core';
|
||||
import { isPlatformBrowser } from '@angular/common';
|
||||
import { bootstrapApplication, BootstrapContext } from '@angular/platform-browser';
|
||||
import { provideServerRendering, withRoutes } from '@angular/ssr';
|
||||
|
||||
@@ -27,9 +28,9 @@ const serverAppConfig = {
|
||||
{
|
||||
provide: APP_INITIALIZER,
|
||||
multi: true,
|
||||
deps: [StationConfigService, PlatformId],
|
||||
deps: [StationConfigService, PLATFORM_ID],
|
||||
useFactory: (svc: StationConfigService, platformId: object) => {
|
||||
if (isPlatformServer(platformId)) {
|
||||
if (!isPlatformBrowser(platformId)) {
|
||||
return () => svc.load().catch(() => {});
|
||||
}
|
||||
return () => {};
|
||||
|
||||
Reference in new issue
Block a user