mirror of https://github.com/abpframework/abp
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.
1.0 KiB
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:
- Signal (readonly)
- 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