api-spec-converter
Version:
Convert API descriptions between popular formats such as OpenAPI(fka Swagger), RAML, API Blueprint, WADL, etc.
16 lines (12 loc) • 410 B
text/typescript
import { Inject, Injectable, PLATFORM_ID } from '@angular/core'
import { isPlatformBrowser, isPlatformServer } from '@angular/common'
()
export class PlatformService {
constructor((PLATFORM_ID) private platformId: any) { }
public isBrowser(): boolean {
return isPlatformBrowser(this.platformId)
}
public isServer(): boolean {
return isPlatformServer(this.platformId)
}
}