PLATFORM_ID is an Angular dependency-injection token that identifies the runtime platform. Inject it into a service, then use isPlatformServer to centralize server-versus-browser decisions for SSR applications. section 27.4.2
Wrap platform detection in a service
PlatformService injects PLATFORM_ID and exposes an isServer getter. RestDataSource uses that getter to select localhost on the server and location.hostname in the browser, avoiding direct browser API access during server execution.
