Angular Signal Generators
    Preparing search index...
    • Creates a readonly signal that reports whether the page is visible. The value comes from document.visibilityState. Listens to the document's visibilitychange event until the injection context is destroyed. Returns true for visible, false for hidden, and undefined when document or its visibility state is unavailable. Page visibility does not indicate whether the document has focus.

      Parameters

      • Optionaloptions: PageVisibleSignalOptions

        Options used when creating the signal. Pass an injector if outside an injection context.

      Returns Signal<boolean | undefined>

      const $pageVisible = pageVisibleSignal();
      effect(() => console.log($pageVisible())); // true, false, or undefined.