injectBatteryResource

Provides a reactive Angular Resource (rxResource) for monitoring device battery level, charging state, and times.

TypeScriptexample.ts
import { injectBatteryResource } from '@angular-helpers/browser-web-apis'

# Properties

FieldTypeDescription
resourceResourceRef<BatteryInfo | null>The reactive Angular ResourceRef.
infoSignal<BatteryInfo | null | undefined>Current battery info shortcut.
isSupportedSignal<boolean>True when Battery API is available.
refresh() => voidTriggers a manual reload of the resource.
LCP N/A
CLS N/A
INP N/A