Browse Source

ssr service added

feature/ssr-migration-schematic
erdemcaygor 1 year ago
parent
commit
4302eefd81
  1. 13
      npm/ng-packs/packages/core/src/lib/services/ssr.service.ts

13
npm/ng-packs/packages/core/src/lib/services/ssr.service.ts

@ -0,0 +1,13 @@
import { Inject, Injectable, PLATFORM_ID } from '@angular/core';
import { isPlatformServer } from '@angular/common';
@Injectable({
providedIn: 'root',
})
export class SSRService {
constructor(@Inject(PLATFORM_ID) private platformId: unknown) {}
isSsr() {
return isPlatformServer(this.platformId);
}
}
Loading…
Cancel
Save