A platform detection service centralizes server-versus-browser checks for applications rendered with SSR. It wraps Angular’s platform APIs so application code can inspect execution context without repeatedly injecting PLATFORM_ID or calling isPlatformServer. section 27.4.2
Detecting server execution
Create PlatformService with an injected PLATFORM_ID value and an isServer getter. Register it with the application module, then use the getter when selecting environment-specific behavior such as a REST endpoint.
