From c47a7e28c7163f8a23a1fdffbce1eaeaa53f718b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Joe=20K=C3=BCng?= Date: Wed, 11 Mar 2026 16:57:03 +0100 Subject: [PATCH] feat(front-end): ssr implementation --- .../features/calculator/calculator-page.component.ts | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/frontend/src/app/features/calculator/calculator-page.component.ts b/frontend/src/app/features/calculator/calculator-page.component.ts index 6a48d71..992bbe6 100644 --- a/frontend/src/app/features/calculator/calculator-page.component.ts +++ b/frontend/src/app/features/calculator/calculator-page.component.ts @@ -4,9 +4,10 @@ import { signal, ViewChild, ElementRef, + Inject, OnInit, + Optional, PLATFORM_ID, - inject, } from '@angular/core'; import { CommonModule, isPlatformBrowser } from '@angular/common'; import { TranslateModule } from '@ngx-translate/core'; @@ -55,7 +56,7 @@ type TrackedPrintSettings = { styleUrl: './calculator-page.component.scss', }) export class CalculatorPageComponent implements OnInit { - private readonly isBrowser = isPlatformBrowser(inject(PLATFORM_ID)); + private readonly isBrowser: boolean; mode = signal<'easy' | 'advanced'>('easy'); step = signal<'upload' | 'quote' | 'details' | 'success'>('upload'); @@ -88,7 +89,10 @@ export class CalculatorPageComponent implements OnInit { private router: Router, private route: ActivatedRoute, private languageService: LanguageService, - ) {} + @Optional() @Inject(PLATFORM_ID) platformId?: Object, + ) { + this.isBrowser = isPlatformBrowser(platformId ?? 'browser'); + } ngOnInit() { this.route.data.subscribe((data) => {