Provides quick access to platform information.
universal/src/services/universal.service.ts
Properties |
|
Methods |
|
constructor(platformId: any)
|
||||||||
Creates an instance of UniversalService.
Parameters:
|
||||||||
Public onBrowser | ||||||||
onBrowser(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on browser platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onNonBrowser | ||||||||
onNonBrowser(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on browser platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onNonServer | ||||||||
onNonServer(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on server platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onNonWorkerApp | ||||||||
onNonWorkerApp(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on worker app platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onNonWorkerUi | ||||||||
onNonWorkerUi(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on worker UI platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onServer | ||||||||
onServer(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on server platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onWorkerApp | ||||||||
onWorkerApp(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on worker app platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public onWorkerUi | ||||||||
onWorkerUi(execute: () => void)
|
||||||||
Type parameters:
|
||||||||
Executes the specified function only on worker UI platfroms.
Parameters:
Returns:
T | undefined
The value returned by the |
||||||||
Public Readonly isPlatformBrowser |
Type: boolean
|
|
Public Readonly isPlatformServer |
Type: boolean
|
|
Public Readonly isPlatformWorkerApp |
Type: boolean
|
|
Public Readonly isPlatformWorkerUi |
Type: boolean
|
|
Public Readonly platformId |
Type: any
|
Decorators:
@Inject(PLATFORM_ID)
|
The id of the current platform. This always equals to `PLATFORM_ID`.
|