You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
abp/docs/en/UI/Angular/Internet-Connection-Service.md

1.0 KiB

Internet Connection Service

InternetConnectionService is a service which is exposed by the @abp/ng.core package. You can use this service in order to check your internet connection

Getting Started

When you inject the InternetConnectionService you can get the current internet status, and it gets immediately updated if the status changes.

InternetConnectionService provides two choices to catch the network status:

  1. Signal (readonly)
  2. Observable

How To Use

İt's easy, just inject the service and get the network status.

You can get via signal

class SomeComponent{
 internetConnectionService = inject(InternetConnectionService);
 isOnline = this.internetConnectionService.networkStatus
}

or you can get the observable

class SomeComponent{
 internetConnectionService = inject(InternetConnectionService);
 isOnline = this.internetConnectionService.networkStatus$
}

To see how we implement to the template, check the InternetConnectionStatusComponent