Closed as not planned
Description
Which @angular/* package(s) are the source of the bug?
core
Is this a regression?
No
Description
I have a problem with a condition in SSR (Server-Side Rendering) related to "hydration." I have a condition based on the screen size, but I see my text content duplicating twice in mobile format. Can I know how to solve this problem without removing the "hydration"?
import { isPlatformBrowser} from '@angular/common';
import {RouterLink} from "@angular/router";
import {ComponentSliderComponent} from '@projects/mod-structure/components/component-slider/component-slider.component';
@Component({
selector: 'page-fr-1',
templateUrl: './page-fr-1.component.html',
styleUrls: ['./page-fr-1.component.css'],
standalone: true,
imports: [RouterLink,ComponentSliderComponent]
})
export class Pagefr1Component {
public isMobile: boolean;
constructor(@Inject(PLATFORM_ID) private platformId: Object) {
if (isPlatformBrowser(this.platformId)) this.isMobile = (window.innerWidth < 600);
}
}
et voici mon html
<div> @if(!isMobile){<p>
<strong style="font-size: 30px; color: rgb(50, 75, 119);">
<em>"Une révolution dans la filtration de l'eau"</em></strong></p><p><br></p><p><strong style="font-size: 30px; color: rgb(102, 102, 102);"></strong><span style="font-size: 24px; color: rgb(50, 75, 119);">Nos cuves par gravité, équipées des filtres </span></p><p><span style="color: rgb(50, 75, 119); font-size: 24px;">Coldstream FTO+, allient innovation et performance </span></p><p><span style="color: rgb(50, 75, 119); font-size: 24px;">pour vous offrir une eau d'une qualité exceptionnelle, </span></p><p class="ql-align-justify"><span style="color: rgb(50, 75, 119); font-size: 24px;">tout en garantissant une autonomie </span></p><p class="ql-align-justify"><span style="color: rgb(50, 75, 119); font-size: 24px;">en eau potable en toutes circonstances.</span></p><p class="ql-align-justify"><br></p>}
@if(isMobile){<p><strong style="font-size: 30px; color: rgb(50, 75, 119);"><em>"Une révolution dans la filtration de l'eau"</em></strong></p><p><br></p><p><strong style="font-size: 30px; color: rgb(102, 102, 102);"></strong><span style="font-size: 24px; color: rgb(50, 75, 119);">Nos cuves par gravité, équipées des filtres </span></p><p><span style="color: rgb(50, 75, 119); font-size: 24px;">Coldstream FTO+, allient innovation et performance </span></p><p><span style="color: rgb(50, 75, 119); font-size: 24px;">pour vous offrir une eau d'une qualité exceptionnelle, </span></p><p class="ql-align-justify"><span style="color: rgb(50, 75, 119); font-size: 24px;">tout en garantissant une autonomie </span></p><p class="ql-align-justify"><span style="color: rgb(50, 75, 119); font-size: 24px;">en eau potable en toutes circonstances.</span></p><p class="ql-align-justify"><br></p>}</div>
Please provide a link to a minimal reproduction of the bug
Please provide the exception or error you saw

Please provide the environment you discovered this bug in (run ng version
)
{
"name": "site",
"version": "0.0.0",
"scripts": {
"ng": "ng",
"start": "ng serve",
"build": "ng build",
"watch": "ng build --watch --configuration development",
"test": "ng test",
"serve:ssr": "node dist/server/server.mjs"
},
"private": true,
"dependencies": {
"@angular/animations": "^17.0.0",
"@angular/common": "^17.0.0",
"@angular/compiler": "^17.0.0",
"@angular/core": "^17.0.0",
"@angular/forms": "^17.0.0",
"@angular/platform-browser": "^17.0.0",
"@angular/platform-browser-dynamic": "^17.0.0",
"@angular/platform-server": "^17.0.0",
"@angular/router": "^17.0.0",
"@angular/ssr": "^17.0.0",
"@angular/cdk": "17.0.0",
"@angular/google-maps": "^17.0.0",
"@angular/material": "^17.0.0",
"@angular/material-moment-adapter": "^17.0.0",
"@ngx-translate/core": "^15.0.0",
"@ngx-translate/http-loader": "^8.0.0",
"js-sha256": "^0.10.1",
"ngx-cookie-service": "^17.0.0",
"express": "^4.18.2",
"rxjs": "~7.8.0",
"tslib": "^2.3.0",
"zone.js": "~0.14.2"
},
"devDependencies": {
"@angular-devkit/build-angular": "^17.0.0",
"@angular/cli": "^17.0.0",
"@angular/compiler-cli": "^17.0.0",
"@types/express": "^4.17.17",
"@types/jasmine": "~5.1.0",
"@types/node": "^18.18.0",
"jasmine-core": "~5.1.0",
"karma": "~6.4.0",
"karma-chrome-launcher": "~3.2.0",
"karma-coverage": "~2.2.0",
"karma-jasmine": "~5.1.0",
"karma-jasmine-html-reporter": "~2.1.0",
"typescript": "~5.2.2"
}
}
Anything else?
No response