Angular Signal Generators
    Preparing search index...
    • Creates a readonly signal that reports the browser's online status. The initial value comes from navigator.onLine. Listens to the window's online and offline events until the injection context is destroyed. Returns undefined when window or navigator is unavailable, or navigator.onLine is not supported. An online value does not guarantee that a particular server or the Internet is reachable.

      Parameters

      • Optionaloptions: OnlineSignalOptions

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

      Returns Signal<boolean | undefined>

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